8

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

pixel
  • 183
  • 1
  • 1
  • 5
  • 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 '15 at 10:26

2 Answers2

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'
duenni
  • 2,939
  • 1
  • 22
  • 38
  • 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 '15 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

Reaces
  • 5,547
  • 4
  • 36
  • 46