Dnsmasq not giving out second DNS

dnsmasqdomain-name-systemmac-osx

Dnsmasq version 2.79 on MacOS 10.12.6 using Homebrew.
This is my dnsmasq config:

# Never forward plain names (without a dot or domain part)
domain-needed

# Never forward addresses in the non-routed address spaces.
bogus-priv

# If you want dnsmasq to listen for DHCP and DNS requests only on
# specified interfaces (and the loopback) give the name of the
# interface (eg eth0) here.
# Repeat the line for more than one interface.
interface=en4

# Always allocate the host with Ethernet address 11:22:33:44:55:66
# The IP address 192.168.0.60

<bunch of hosts>


# Do the same thing, but using the option name
dhcp-option=option:router,192.168.2.1
dhcp-option=option:ntp-server,192.168.2.1
dhcp-option=6,192.168.2.1,8.8.8.8,8.8.4.4

# Log lots of extra information about DHCP transactions.
log-dhcp

Important part is the options part.
I am trying to achieve that my DHCP clients get three DNS servers configured: 192.168.2.1 and the two Google ones.
However, this is what i get when i sniff the DHCP traffic coming from this server:

---------------------------------------------------------------------------

  TIME: 2018-05-21 17:40:37.454
    IP: 192.168.2.1 (f6:5c:89:ca:e0:64) > 192.168.2.30 (0:50:b6:22:8e:6e)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 80916f1c
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 192.168.2.30
SIADDR: 192.168.2.1
GIADDR: 0.0.0.0
CHADDR: 00:50:b6:22:8e:6e:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         5 (DHCPACK)
OPTION:  54 (  4) Server identifier         192.168.2.1
OPTION:  51 (  4) IP address leasetime      43200 (12h)
OPTION:  58 (  4) T1                        21600 (6h)
OPTION:  59 (  4) T2                        37800 (10h30m)
OPTION:   1 (  4) Subnet mask               255.255.255.0
OPTION:  28 (  4) Broadcast address         192.168.2.255
OPTION:   3 (  4) Routers                   192.168.2.1
OPTION:   6 (  4) DNS server                192.168.2.1
OPTION:  12 (  8) Host name                 aimdroid
OPTION:  42 (  4) NTP servers               192.168.2.1
---------------------------------------------------------------------------

Only one DNS server is reported. What is going wrong here?

Best Answer

This works for pi-hole (based on dnsmasq, should be exact same configuration):

dhcp-option=option:dns-server,10.0.0.5,10.0.0.10

not sure why your example does not work - it seems correct. Have you tried just using 2 instead of 3 server IPs?

Related Topic