IPv6 config to advertise local DNS server

I have a network connection through a stock firmware router, for which my OpenWRT box acts as DHCP server (no routing) - meaning it configures all my hosts with IP address, subnet, gateway (the stock router) and DNS servers (standalone DNS, followed by OpenWRT, followed by the main router):
image
This works excellent for IPv4 but not for IPv6.
While the main router uses DHCPv6 to get its configuration from the ISP, hosts use SLAAC to configure themselves based on the RAs they get from the main router, which contains the prefix and the Recursive DNS servers it obtained from the ISP.

My issue is that Windows 10 now prefers the IPv6 DNS servers and I've lost both local hostname resolution and the filtering I would normally do through my standalone DNS server (PiHole). While I know that there's probably no way for OpenWRT to link the IPv4 hostnames to the IPv6 address they've autoconfigured themselves, I would like to be able to advertise my custom DNS server's IP address in the network (possibly through NDP? or an RA with only RDNSS?)

I've found this page on the wiki but I don't have a /etc/config/radvd file, nor could I find any information about what happens if I configure Router Advertisement service as server/relay/hybrid in LuCI (right now it's disabled), and the same for DHCPv6-service and NDP-Proxy. I do have an "announced DNS servers" on the same page and I've put my standalone DNS's LinkLocal IPv6 address in it, but I still don't see any advertisements on the network containing that.

Edit: There's apparently an ip6neigh project which can use neighbor advertisements from hosts using SLAAC to match them with IPv4 hostname entries.

1 Like

Have you tried to hit the tab on the LAN Interface that says "IPv6 Settings" - and place the DNS servers in the "Announced DNS servers" section?

Screenshot%20from%202018-12-14%2008-46-12

You should be able to use its Local IPv6 IPs, ULA or assigned Public IP.

1 Like

OpenWRT is not my main router so I'm wary of setting it to DHCPv6 and RA server mode - I'm afraid hosts will get conflicting configuration from the mai router and from OpenWRT. And if I stop the IPv6 configuration on the main router, how will OpenWRT get the Router Advertisement to get the prefix & gateway?

Then don't set DHCPv6. Obviously your inquiry is about announcing DNS servers.

:confused:

Then how do you plan to announce - if you turn off the Router Announcement Service???

You have to:

  • static address; or
  • ask the ISP to give you a block greater than /64.

I didn’t manage to get IPv6 DNS announcements. However I would either switch off the DHCP on your “main router” or set it to bridge mode and use OpenWRT’s DHCP server and DNS. Then point pihole to your openWRT as upstream dns server. On openwrt create static leases with hostname, ipv4 and ipv6 suffix for the local machines you want to be able to access locally by hostname via ipv4 and ipv6. Either you only use ipv4 dns or you manually add the ipv6 address of your pihole machine to the clients dns settings. I did it this way (except for the “main router” part) since certain clients want normal dns access (without pihole blocking), and just use the dhcp propagated openwrt ipv4 and ipv6 addresses.
It seems you could use DHCPv6 somehow, but I don’t have native ipv6 here so I haven’t used that.

Good luck!

I have managed a workaround (in my opinion) by setting the IPv6 DNS server address of my MAIN router to the LinkLocal address of my DNS server:
image
So far it's working fine although I suspect Name Resolution might not work on my main router (should not be a problem at the moment, NTP which is the only service it uses works fine via IPv4). I've also set my DNS server to use OpenDNS's IPv6 servers for upstream resolution, instead of my ISP's.

Your link local IP is static...perhaps that wasn't clear...glad you got it working.

:+1:

I also encountered the same problem as you did. In my case the main router is OpenWrt-enabled (DHCP v4/v6 server), and a Linux box is used to provide DNS resolving service, and proxy, etc.

My solution to this issue is forward the DNS lookup to Linux box in the main router.

uci add_list dhcp.@dnsmasq[-1].server='192.168.10.14'
uci set dhcp.@dnsmasq[-1].noresolv=1
uci commit

But in my case, i want proxy all the traffic of LAN devices via the Linux box (Gateway). For IPv4,

dhcp_option='3, 92.168.10.14'

will meet this need, and IPv4 traffic is forwarded to the Gateway. However, i failed to find a solution to announce IPv6 default router (Linux box's link local IPv6 address) in DHCPv6 settings (BTW, NAT6 is used in my case), there's only a "ra_default" in dhcp/lan setting. In other words, i need a "dhcpv6_option". Do you have any idea about this problem?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.