Allow multiple IPv6 entries for one domain in local DNS

Opening this as a feature request.

Versions

  • Pi-hole version is v5.2.4 (Latest: v5.2.4)
  • AdminLTE version is v5.3.2 (Latest: v5.3.2)
  • FTL version is v5.6 (Latest: v5.6)

Platform

  • OS and version: Ubuntu Server 20.10
  • Platform: Raspberry Pi 4

Expected behavior

Add multiple IPv6 entries for one and the same domain.

Actual behavior / bug

An error message is thrown that an IPv6 for that domain already exists.

Discussion

As multiple IPv6 addresses for one interface are a core concept of IPv6, Dnsmasq will also allow multiple addresses in general. The restriction in Pi-Hole is a blocker if you are heavily relying on reverse-lookups of IPv6 addresses. I would consider this as a bug, since it is against standards. I'm currently working around this by editing the file without GUI.

Solution should be simple: remove the duplicate check for IPv6. Everything else is already proper handled by Dnsmasqs core with hosts files.

The request itself seems valid enough, but I'd consider this a limitation in Pi-hole's UI, not a bug.

We are trying to improve where we can with the limited resources we have, and are happy with user's contributing.
AFIAA, the existing UI for Local DNS records has been added by a user's pull request, and at that time was likely sufficient to address their immediate needs.

It certainly can be improved, but even in its current state, I think it already adds benefit for Pi-hole's less CLI-experienced users.

Interfaces are irrelevant to DNS.

Associating a hostname with multiple IP addresses is quite possible in DNS (IPv4 or IPv6 regardless), and Pi-hole does not limit that. It just doesn't support doing that through its UI.
While this is certainly a shortcoming, it is also true for the vast majority of dnsmasq options, and Pi-hole does not position itself as an all-around UI frontend for dnsmasq.

You were always and still are free to add your own custom dnsmasq configuration as you see fit, as long as it doesn't conflict with Pi-hole's own options, and we -as a community- are happy to help you along with those (provided we know about them).

But since you seem to have looked into the sources yourself already, would you be able to go all the way and file a respective pull request?

However, before you consider doing so:

If it's reverse lookups you're after, you may still not get quite what you expected:
(quoting from dnsmasq documentation)

Only the first address creates a PTR record linking the address to the name.
This is the same rule as is used reading hosts-files.

Hi @Bucking_Horn,

thanks for your answer.

If you are adding a addn-hosts-file with several IPs (IPv6 as well as IPv4) for one domain, Dnsmasq will resolve all IPs correctly via rDNS .arpa.

This is what I am actually doing with my records via addn-hosts in a separate configuration file for Dnsmasq.

I'll try to find time for it.