Skip to content

Commit 433b3b8

Browse files
committed
add --dns-nocache option
1 parent e8284c5 commit 433b3b8

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,17 +284,17 @@ Options:
284284
queries to other interfaces)
285285
-n Do not provide Internet (See Notice 1)
286286
--ban-priv Disallow clients to access my private network
287-
287+
288288
-g <ip> This host's IPv4 address in subnet (mask is /24)
289289
(example: '192.168.5.1' or '5' shortly)
290290
-6 Enable IPv6 (NAT)
291291
--no4 Disable IPv4 Internet (not forwarding IPv4)
292292
(See Notice 1). Usually used with '-6'
293-
293+
294294
--p6 <prefix> Set IPv6 LAN address prefix (length 64)
295295
(example: 'fd00:0:0:5::' or '5' shortly)
296296
Using this enables '-6'
297-
297+
298298
--dns <ip>|<port>|<ip:port>
299299
DNS server's upstream DNS.
300300
Use ',' to seperate multiple servers
@@ -317,21 +317,22 @@ Options:
317317
-d DNS server will take into account /etc/hosts
318318
-e <hosts_file> DNS server will take into account additional
319319
hosts file
320-
320+
--dns-nocache DNS server no cache
321+
321322
--mac <MAC> Set MAC address
322323
--random-mac Use random MAC address
323-
324+
324325
--tp <port> Transparent proxy,
325326
redirect non-LAN TCP and UDP traffic to port.
326327
(usually used with '--dns')
327-
328+
328329
WiFi hotspot options:
329330
--ap <wifi interface> <SSID>
330331
Create WiFi access point
331332
-p, --password <password>
332333
WiFi password
333334
--qr Show WiFi QR code in terminal
334-
335+
335336
--hidden Hide access point (not broadcast SSID)
336337
--no-virt Do not create virtual interface
337338
Using this you can't use same wlan interface
@@ -350,12 +351,12 @@ Options:
350351
(defaults to /etc/hostapd/hostapd.accept)
351352
--hostapd-debug <level> 1 or 2. Passes -d or -dd to hostapd
352353
--isolate-clients Disable wifi communication between clients
353-
354+
354355
--ieee80211n Enable IEEE 802.11n (HT)
355356
--ieee80211ac Enable IEEE 802.11ac (VHT)
356357
--ht_capab <HT> HT capabilities (default: [HT40+])
357358
--vht_capab <VHT> VHT capabilities
358-
359+
359360
--no-haveged Do not run haveged automatically when needed
360361
361362
Instance managing:

lnxrouter

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Options:
6767
-d DNS server will take into account /etc/hosts
6868
-e <hosts_file> DNS server will take into account additional
6969
hosts file
70+
--dns-nocache DNS server no cache
7071
7172
--mac <MAC> Set MAC address
7273
--random-mac Use random MAC address
@@ -156,6 +157,7 @@ define_global_variables(){
156157
SHOW_DNS_QUERY=0 # log dns
157158
ETC_HOSTS=0
158159
ADDN_HOSTS=
160+
DNS_NOCACHE=
159161
CONN_IFACE= # which interface user choose to use to create network
160162
INTERNET_IFACE= # which interface to get Internet from
161163
THISHOSTNAME= # this host's name the DNS tells clients
@@ -322,6 +324,10 @@ parse_user_options(){
322324
ADDN_HOSTS="$1"
323325
shift
324326
;;
327+
--dns-nocache)
328+
shift
329+
DNS_NOCACHE=1
330+
;;
325331

326332
--isolate-clients)
327333
shift
@@ -1822,6 +1828,10 @@ write_dnsmasq_conf() {
18221828
no-poll
18231829
EOF
18241830
fi
1831+
if [[ $DNS_NOCACHE -eq 1 ]]; then
1832+
echo "cache-size=0" >> "$CONFDIR/dnsmasq.conf"
1833+
echo "no-negcache" >> "$CONFDIR/dnsmasq.conf"
1834+
fi
18251835
if [[ $IPV6 -eq 1 ]];then
18261836
cat <<- EOF >> "$CONFDIR/dnsmasq.conf"
18271837
listen-address=${GATEWAY6}

0 commit comments

Comments
 (0)