DHCP Server does not deliver DNS

Hi.

I have an issue with a snapshot r15889. The DHCP does not deliver the DNS server to my windows clients. I have a more complex installation with VPN and another remote DNS Server request should forwarded to. Everything works fine except the DHCP behaviour. So I think we can ignore this in detail. In config DHCP I set the DNS to the correct IP but my laptop does not get it. Any ideas? Perhaps I missed a setting, I did everything with LUCI.

remote location (DNS 192.168.177.1) <---VPN---> local (DNS 192.168.178.7) (here I have the issue with DNS and DHCP)

Networks are totally independent and do not use any central component.

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option ednspacket_max '1232'
        list rebind_domain 'muc.local'
        option confdir '/tmp/dnsmasq.d'
        option local '/ham.local/'
        option domain 'ham.local'
        option localservice '0'
        list server '/muc.local/192.168.177.1'

config dhcp 'lan'
        option interface 'lan'
        option limit '150'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        option ra_slaac '1'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'
        option ra_management '1'
        option start '21'
        list dns '192.168.178.7'
        option leasetime '1d'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

Cheers,
Nils

It seems you are not using odhcpd as your IPv4 DHCP server since dhcp.odhcpd.maindhcp is set to '0'. When you use dnsmasq then you need another configuration than the 'dns' option: https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#providing_custom_dns_with_dhcp

2 Likes

Hi.

I changed it according the manual but also not working. Should I switch to odhcpd? I use dnsmasq because it was the standard setting. So it is not necessary for me to stay.

config dhcp 'lan'
        option interface 'lan'
        option limit '150'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        option ra_slaac '1'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'
        option ra_management '1'
        option start '21'
        list dns '192.168.178.7'
        option leasetime '1d'
        list dhcp_option '6,192.168.178.7'

The domain .local is reserved for mDNS and is not supposed to be resolved by any DNS server.
You'd best change the domain to something else, such as .lan or .home.

Also verify the following:

  • This is the only DHCP server on your network.
  • Network and DNS configuration is automatic on the clients.
  • Clients do not use DoH or DoT.
  • Firewall allows passing for transit DNS traffic.
  • You have not set up DNS hijacking.
  • DNS sever is allowed to reply to queries outside its network.
1 Like

Hi,

I checked it and everything is fine. Can see DHCP request in logs and IP given is fine.

DNS server can be queried with NSLOOKUP with -server option. Interesting is that it is also shown in adapter configuration. But if I start NSLOOKUP it said "standardserver unknown". Other devices like iPhone works fine. Perhaps not a problem with OpenWRT? Mhhh...

Ok, with ipconfig /all I can see the DNS Server set...

1 Like

I Ok, it seems that the Router does not deliver IPv6 DNS over DHCP and so the Windows 10 client uses a IPv6 default server from Microsoft. This is preferred before the IP4 DNS which is delivered correctly.

Wireshark does not show any sensefull DHCPv6 request but my laptop contains my router at last. Also there are no active DHCPv6 leases. Only one but this is not my laptop. Does I have to change something to support DHCPv6???


   DNS-Server  . . . . . . . . . . . : fda6:e2c7:16ca::1
                                       192.168.178.7
                                       fd00::eadf:70ff:fe75:579f
                                       fda6:e2c7:16ca::1
                                       fd5b:de6:7da8::1

Does not configured IPv6 correctly as my router is behind a fritzbox. This makes ip6v bahavior wrong. Will spend some time to find the correct configuration...