Gargoyle should give out specified DNS servers to users
Moderator: Moderators
-
- Posts: 36
- Joined: Mon Nov 12, 2018 6:04 am
Gargoyle should give out specified DNS servers to users
At the moment the DHCP server is always returning the router's IP address as the DNS server to the clients. How can I change it so that the DNS servers are returned to the DHCP clients?
Re: Gargoyle should give out specified DNS servers to users
You can do this manually.
If you want DNS for all clients, follow these steps:
More information here: https://openwrt.org/docs/guide-user/bas ... cp_options
If you want DNS for all clients, follow these steps:
Code: Select all
uci add_list dhcp.lan.dhcp_option="6,8.8.8.8,8.8.4.4"
uci commit dhcp
/etc/init.d/dnsmasq restart
Turris Omnia with OpenWrt 21.02 - Tested
Linksys WRT3200ACM with Gargoyle 1.13.x
TL-WR1043ND v2 with Gargoyle 1.10.0
http://gargoyle.romanhk.cz custom builds by gargoyle users
Linksys WRT3200ACM with Gargoyle 1.13.x
TL-WR1043ND v2 with Gargoyle 1.10.0
http://gargoyle.romanhk.cz custom builds by gargoyle users
-
- Posts: 36
- Joined: Mon Nov 12, 2018 6:04 am
Re: Gargoyle should give out specified DNS servers to users
Thanks for the reply, that seems doable. Anything possible to read these values from Gargoyle web interface?
Would be nice if there was a setting in web interface somewhere to give out these servers to clients, this is what most routers do I've used in the past.
E:
A friend helped me with a script to place in init.d, this:
I still think an option for this should exist in UI though, I've recently received a Raspberry Pi with PiHole and for stats I have no use in only seeing the router show up.
Would be nice if there was a setting in web interface somewhere to give out these servers to clients, this is what most routers do I've used in the past.
E:
A friend helped me with a script to place in init.d, this:
Restart router after you change the DNS through web interface.#!/bin/sh
START=10
STOP=15
start() {
v=$(uci get network.lan.dns)
d="6,${v}"
uci set dhcp.lan.dhcp_option="$d"
uci commit dhcp
/etc/init.d/dnsmasq restart
}
stop() {
echo 'done'
}
I still think an option for this should exist in UI though, I've recently received a Raspberry Pi with PiHole and for stats I have no use in only seeing the router show up.
Re: Gargoyle should give out specified DNS servers to users
If your home network is using a separate DNS server like Pi-hole, you should consider adjusting your router configuration so that the DNS server's address is only given to DHCP clients, and not used by the router itself. Why? Because if you enable a feature like Pi-hole's conditional forwarding, which allows the server to map IP addresses to names by looking them up in the router's DNS, any such queries that the router can't answer will be forwarded back to the DNS server, creating an infinite loop until the maximum number of queries per second is reached.
I found that devices which are capable of unicast DNS service discovery (e.g. Apple devices) would often check if the DNS had any services to advertise by issuing PTR queries for b._dns-sd._udp.0.1.168.192{dot}in-addr{dot}arpa, lb._dns-sd._udp.0.1.168.192{dot}in-addr{dot}arpa, or db._dns-sd._udp.0.1.168.192{dot}in-addr{dot}arpa (depending on the IP address range in use). Also, since I had a custom local domain set to "home" on both the router and Pi-hole's conditional forwarding, PTR queries for b._dns-sd._udp.home, lb._dns-sd._udp.home, and db._dns-sd._udp.home were also being issued and bouncing back and forth. But it's not just these automated queries that be problematic; something as simple as running issues A, AAAA, and MX record queries, the last of which causes yet another loop because the DHCP server doesn't specify that information.
The fix was to simply set the router to only use external DNS servers in Connection > Basic, then set the DHCP server to distribute the Pi-hole IP address instead.
I found that devices which are capable of unicast DNS service discovery (e.g. Apple devices) would often check if the DNS had any services to advertise by issuing PTR queries for b._dns-sd._udp.0.1.168.192{dot}in-addr{dot}arpa, lb._dns-sd._udp.0.1.168.192{dot}in-addr{dot}arpa, or db._dns-sd._udp.0.1.168.192{dot}in-addr{dot}arpa (depending on the IP address range in use). Also, since I had a custom local domain set to "home" on both the router and Pi-hole's conditional forwarding, PTR queries for b._dns-sd._udp.home, lb._dns-sd._udp.home, and db._dns-sd._udp.home were also being issued and bouncing back and forth. But it's not just these automated queries that be problematic; something as simple as running
Code: Select all
host LocalDeviceName.home
The fix was to simply set the router to only use external DNS servers in Connection > Basic, then set the DHCP server to distribute the Pi-hole IP address instead.
Code: Select all
# clear the previous setting if necessary
uci delete dhcp.lan.dhcp_option
uci commit dhcp
# set which DNS server to assign DHCP clients
uci add_list dhcp.lan.dhcp_option="option:dns-server,192.168.1.254"
uci commit dhcp
/etc/init.d/dnsmasq restart