Skip to content

Commit 98d9886

Browse files
authored
feat(flashstart): allow setting of logqueries and rebind in generated servers (#1283)
1 parent ec80371 commit 98d9886

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

packages/ns-flashstart/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ uci commit flashstart
4040
reload_config
4141
```
4242

43+
## DNS server customization
44+
45+
You can disable `rebind_protection` or enable `logqueries` options for the DNS servers by setting the variables in the
46+
`flashstart.global` section:
47+
48+
```
49+
uci set flashstart.global.rebind_protection="0"
50+
uci set flashstart.global.logqueries="1"
51+
uci commit flashstart
52+
reload_config
53+
```
54+
4355
## Debug mode
4456

4557
The daemon can be run in various logging levels, to set the levels you can:

packages/ns-flashstart/files/ns-flashstart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ def __sync_pro_profiles():
213213

214214

215215
def __add_profile(port, profile):
216+
query_logging = e_uci.get('flashstart', 'global', 'logqueries', default=False, dtype=bool)
217+
rebind_protection = e_uci.get('flashstart', 'global', 'rebind_protection', default=True, dtype=bool)
216218
if e_uci.get('dhcp', profile['id'], default=None) is None:
217219
logging.info(f'New profile found {profile["name"]}, creating instance {profile["id"]}.')
218220
e_uci.set('dhcp', profile['id'], 'dnsmasq')
@@ -224,6 +226,8 @@ def __add_profile(port, profile):
224226
e_uci.set('dhcp', profile['id'], 'noresolv', True)
225227
e_uci.set('dhcp', profile['id'], 'max_ttl', 60)
226228
e_uci.set('dhcp', profile['id'], 'max_cache_ttl', 60)
229+
e_uci.set('dhcp', profile['id'], 'logqueries', query_logging)
230+
e_uci.set('dhcp', profile['id'], 'rebind_protection', rebind_protection)
227231
# sets always get replaced, checking before replacing
228232
custom_servers = list(e_uci.get('flashstart', 'global', 'custom_servers', list=True, dtype=str, default=[]))
229233
servers = sorted(custom_servers + profile['servers'])

0 commit comments

Comments
 (0)