How to advertise custom DNS for DHCP clients?

3 posts / 0 new
Last post
spxak1
spxak1's picture
How to advertise custom DNS for DHCP clients?

I want my R7800 to advertise a different DNS server to its own address when it hanldes DHCP. My router is 10.20.30.40 and when it is set to DHCP server, all my clients get their IP, DNS and Gateway in this form e.g ip: 10.20.30.65, dns: 10.20.30.40, gate:10.20.30.40.

I run a pi.hole and while (10.20.30.60) and I would like it to be advertised as the DNS server. I know I can just set the router to use it for DNS, but the clients still get the router as their DNS server and as such all connection to my pi.hole appears to be coming from the router. This way I miss on checking individual clients' requests.

So is there a way for the R7800 to advertise a DNS server other than itself? 

I use Voxel's .61 firmware.

 

Thank you.

W1lliam
W1lliam's picture
if you wanna to take fixed

if you wanna to take fixed DNS server other than default, the router, here is a quick way to do it

1. Enable telnet for R7800

2. Telnet to R7800

3. change to /etc/init.d

4. vi net-lan

5. jump to print_dhcpd_conf()

6. replace the line "option dns $($CONFIG get lan_ipaddr)" with "option dns aaa.bbb.ccc.ddd", where aaa.bbb.ccc.ddd is your preferred DNS server, you cna create up to 3 entries.

7. save and reboot R7800

spxak1
spxak1's picture
Thank you. I will try this as

Thank you. I will try this as soon as possible.