8

I would like to serve custom DNS server to dhcp clients. How I can achieve that in openWrt?

1
  • 2
    This question is not too broad because it gets very specific answers. It's sad that basic idea of asking questions and getting answers is corrupted by policies abuse...
    – pixel
    Jan 30, 2015 at 10:26

2 Answers 2

14

DNS server adress corresponds to DHCP option 006. According to the OpenWRT Wiki your /etc/config/dhcp should look like

config 'dhcp' 'lan'
    ...
    list 'dhcp_option' '6,yourDNSIP'
1
  • Seems like you beat me to it by a few seconds, I'll leave my answer open as it is dnsmasq specific :)
    – Reaces
    Jan 29, 2015 at 12:30
8

If you have dnsmasq enabled you need to use DHCP-option 6

So in /etc/dnsmasq.conf you would add:

dhcp-option=6,8.8.8.8,8.8.4.4

To add the google DNS servers

1
  • What does option 6 do? What are the other options (e.g. 1-5)?
    – craibuc
    Aug 2, 2018 at 13:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.