Create local DNS host entry pointing to interface IPv6 address

Started by cinergi, December 01, 2025, 09:37:42 PM

Previous topic - Next topic
Hello,

I'm running OPNsense 2.7.8 with DNSmasq for DHCP and local host name resolution.  I'm trying to set a local DNS host entry pointing to the interface's IPv6 address.  Since this address is derived from the WAN prefix delegation and could therefore change, I'm hesitant to hard-code the IPv6 address in the DNS host entry.  Is there any way to specify "this interface IP address"?  When setting custom DHCP options, for example, it's possible to specify [..] for the interface IP which would be perfect in this case, but this doesn't seem to be supported for DNS host entries - only DHCP options.

Thanks!

Take a look at this - maybe you do not want / need "internal" IPv6 at all after reading it.

You are correct: While you can create a dynamic IPv6 firewall alias, you cannot create the same for (internal) DNS. However, you can use the link-local address that is derived from the EUI-64. That is, iff you use SLAAC and not DHCPv6 for IP assigments (which you should).

You can, of course, use dynamic DNS to update by an interface IPv6 prefix and an EUI-64 suffix. Some DDNS service providers allow to keep the suffix, such that OpnSense can update the prefix only.
Intel N100, 4* I226-V, 2* 82559, 16 GByte, 500 GByte NVME, ZTE F6005

1100 down / 800 up, Bufferbloat A+

If your GUA prefix is dynamic, my general advice is to additionally deploy ULAs and use these in internal DNS zones.

Cheers
Maurice
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).