Local clients' AAAA records with track6 and dnsmasq

Started by sbellon, November 19, 2021, 08:41:35 AM

Previous topic - Next topic
Hi all,

when using track6 on the LAN interfaces, can something be configured that local clients' IPv6 addresses are registered as AAAA records when using dnsmasq?

TIA.

Greetings,
Stefan


Wow, this is strange ...

I just noticed that name resolution of local host names in my LAN works for A records but not for AAAA records.

I thought, let's go to OPNsense forums and search ... then I found this topic and ... :-o

Two things:

1) I completely forgot I had asked this seven months ago already.

2) I'm also puzzled as to why this got no response. Am I the only one with that issue or is my expectation stupid?

It only works for static mappings. isc-dhcp does not offer host names in IPv6. In dynamic environments use empty prefix addresses as such ::1, etc and they will be expanded automatically.


Cheers,
Franco

I'm sorry, I do not understand what you mean with "use empty prefix addresses such as ::1" ... where?

I have configured DHCPv4 for interface LAN, configured an IP range and also defined some static mappings. For the dynamic ones as well as the static ones I can properly get name resolution for A records.

If possible, I'd like to get the same for AAAA records, but I am unsure of a) whether that works at all (from your "isc-dhcp does not offer host names in IPv6" it sounds like it doesn't) or b) how to configure it.

Again, host names are not registered in IPv6. We don't get the information in the DHCP server lease file.

# grep hostname /var/dhcpd/var/db/dhcpd.leases | wc -l
      12

vs.

# grep hostname /var/dhcpd/var/db/dhcpd6.leases | wc -l
       0

It's a small deployment, but it does have IPv6 devices.

In order to be able to use host names for IPv6 addresses it requires static mappings, go to e.g. "Services: DHCPv6: [LAN]" and at the bottom of the page there is a "DHCPv6 Static Mappings for this interface." table. There you can enter a hostname, DUID (MAC equivalent) and address. If you have a tracking interface in the manual mode where DHCPv6 configuration is permitted these addresses will merge the prefix of your interface (/64) with the suffix address you give. Prefix abcd::/64 and address ::1 will be merged as abcd::1.


Cheers,
Franco

I appreciate your help very much (and of course also the work you put into OPNsense)!

Ok, I understood the fact that I need static mappings for IPv6 in order to get name resolution. That's fine with me.

However, I do not have "Services: DHCPv6: [LAN]", I only have "Relay" and "Leases" there. BTW: Relay is not enabled because I wouldn't know where to relay to.

I'm sure that I'm still missing something (small) ...

Ah, I need to enable "Allow manual adjustement of DHCPv6 and Router Advertisements", then enable "Services: DHCPv6: [LAN]" and configure it.

Yes. If the interface doesn't have a static address manual mode is required and set from the interface settings itself which will disable the automatic configuration of radvd/dhcpv6.


Cheers,
Franco

Thanks for your help.

To summarize (for others, searching for similar keywords and finding this topic in the future):

- Interfaces -> [LAN] -> Track IPv6 Interface -> [v] Allow manual adjustments of DHCPv6 and Router Advertisements
- Services -> DHCPv6 -> [LAN] -> Enable (and define Lease range)
- Services -> Router Advertisements -> [LAN] -> Assisted

Then setting static IPv6 mappings via Services -> DHCPv6 -> [LAN] (or Leases) are reflected in /var/etc/dnsmasq-hosts and thus IPv4 and (those) IPv6 addresses can be resolved when using OPNsense as name server.