OpenWrt Forum Archive

Topic: Send different DNS servers to different hosts

The content of this topic has been archived on 19 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Ok, so is there a way for me to get dnsmasq to send a different DNS server to a machine based on it's MAC or IP address?

Something like, my WiFi clients have their open DNS server and my wired clients use a different server.

Or, a more practical example, my kid's laptop has one DNS server and my personal machine uses another.  This would allow me to limit the sites that the kid laptop could resolve.

I found an even BETTER method (using UCI).  From here:

The section is called "Classifying Clients And Assigning Individual Options"

I added this section to my dhcp config:

config mac
        option mac '<macaddress>'
        option networkid 'specialdns'
        list   dhcp_option '6,<dns>'

where <macaddress> is the mac of the machine that I want to have the specific dns server and <dns> is the IP of the DNS server.

(Last edited by Comitizer on 9 Aug 2013, 03:42)

The discussion might have continued from here.