[Dnsmasq-discuss] dhcp-range for DNS entries: how to gain A and AAAA for same host?

Steffen Nurpmeso steffen at sdaoden.eu
Sun Mar 14 00:39:18 UTC 2021


Hello.

For being more automatic and flexible with (many) VMs i changed
from a static addn-hosts= to a dhcp-hostsfile= approach, which
luckily can still serve as the sole DNS source for already
assigned IPs for all already existing VMs (slowly to be migrated
to DHCP-based addresses, if at all), which is great!
(Of course, this time only when the VM is running, but this does
not really matter here.)

However, i stumbled over a problem on Linux.  If i scp a file with
the name of the VM it tooks a long time, and this is because ssh
uses getaddrinfo, and the GNU C library resolver sends out queries
for A and AAAA at the same time.  The A is delivered quickly by
dnsmasq, but the AAAA one is forwarded (thus subject to fail, on
dotless names).

So i wondered how to add IPv6 support for this config in order to
let dnsmasq simply serve the AAAA in addition, anyway a goal, to
finally relearn, and this time for good, about IPv6.  (I even
"own" an unbelievable amount of them for a time.  Could be used
for something.  Anyhow.)
And this turned out to be impossible.  First i simply changed
a line in the hosts.dnsmasq (this last of some trials)

  54:72:01:01:00:15,alp-2021,10.0.1.21,[::5472:101:15]

but that turned out not to serve, so, understandable that,
i tried to add the IPv6 range to the dhcp-range= line of
dnsmasq.conf, which was

  dhcp-range=10.0.0.1,10.3.255.253,255.252.0.0,24h

until then.  This seems not to work, so i added another

  #dhcp-range=3fb:1::5472:101:1,3fb:1::5472:104:FFFF,24h
and
  #dhcp-range=::1,constructor:vm,24h

at least the latter worked, but now we _only_ had IPv6 in the VM,
and the IPv4 address was not assigned.

In theory this would not be such an issue, but of course the
origin of why i tried to change it was the DNS forwarding of the
C library resolver, and now i wonder what to do.

Is this a misconfiguration, or is there another way to support
IPv4 + IPv6 DHCP, but especially DNS service for both address
types for the same machine?  Thanks.

A nice Sunday i wish, ciao,

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)



More information about the Dnsmasq-discuss mailing list