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

Steffen Nurpmeso steffen at sdaoden.eu
Mon Mar 15 23:35:12 UTC 2021


Geert Stappers wrote in
 <20210315223843.be2shl6pkr3i22qo at gpm.stappers.nl>:
 |On Mon, Mar 15, 2021 at 08:35:44PM +0100, Steffen Nurpmeso:
 |> Geert Stappers wrote:
 |>> On Sun, Mar 14, 2021 at 01:39:18AM +0100, Steffen Nurpmeso
 |>>> For being more automatic and flexible with (many) VMs i changed
 |>>> from a static addn-hosts= to a dhcp-hostsfile= approach, which
 ...
 |>>> 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).
 ...
 |>>>   54:72:01:01:00:15,alp-2021,10.0.1.21,[::5472:101:15]
 ...
 |>>    dhcp-range=10.0.0.1,10.3.255.253,255.252.0.0,24h
 |>>    dhcp-range=3fb:1::5472:101:1,3fb:1::5472:104:FFFF,24h
 ...
 |>   Mar 15 20:04:02 kent dnsmasq-dhcp[27703]: 396513898 client provides \
 |>   name: alp-2021
 |>   Mar 15 20:04:02 kent dnsmasq-dhcp[27703]: 396513898 DHCPREQUEST(vm) \
 |>   10.0.1.21 54:72:01:01:00:15
 |>   Mar 15 20:04:02 kent dnsmasq-dhcp[27703]: 396513898 tags: known, vm
 |>   Mar 15 20:04:02 kent dnsmasq-dhcp[27703]: 396513898 DHCPACK(vm) \
 |>   10.0.1.21 54:72:01:01:00:15 alp-2021
 |      ...
 |>   Mar 15 20:04:02 kent dnsmasq-dhcp[27703]: 396513898 sent size: \
 |>    8 option: 12 hostname  alp-2021
 |
 |So only  DHCPv4, no sign of  DHCPv6

Well yes, sorry, i am not an admin, i have not yet looked into
this at all.  It was a Saturday's quick shot to get rid of the
hang that i was not used to in the past.
I also tried it with ArchLinux that uses systemd me thinks,
whereas i have no idea of that either, doesn't it try that.

 |>   Mar 15 20:05:11 kent dnsmasq[27703]: 10 127.0.0.1/22091 query[A] \
 |>   alp-2021 from 127.0.0.1
 |>   Mar 15 20:05:11 kent dnsmasq[27703]: 10 127.0.0.1/22091 DHCP alp-2021 \
 |>   is 10.0.1.21
 |
 |Yes
 |
 |>   Mar 15 20:05:11 kent dnsmasq[27703]: 11 127.0.0.1/22091 query[AAAA] \
 |>   alp-2021 from 127.0.0.1
 |>   Mar 15 20:05:11 kent dnsmasq[27703]: 11 127.0.0.1/22091 forwarded \
 |>   alp-2021 to 10.5.0.2
 |
 |That forward is justified.
 |Dnsmasq hasn't seen that alp-2021 is doing IPv6.

Yes.  That is the problem.

  ...
 |> I mean, it is not really a problem, i can easily generate IPv6
 |> entries from the hosts.dnsmasq, but the fun would now be to become
 |> completely automatic, only storing the MAC and a name in that
 |> file, or even generating as many as desired on the fly,
 |> dynamically, and still being able to spin them up with dnsmasq,
 |> after having reread the updated file, serving them properly via
 |> DNS for IPv4 and/or (later maybe even tending for or) IPv6.
 |> 
 |>> P.S.
 |>> Original poster might
 |>> deem https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2021q1/01\
 |>> 4810.html
 |>> usefull.
 |> 
 |> For me it would be nice that if dnsmasq serves only IPv4 via DHCP
 |> even though the hosts.dnsmasq has according entries for IPv4 and
 |> IPv6, it would not forward the IPv6 query (and vice versa).
 |> Forward looking it would be even better if there would be
 |> a configuration option so that i would only create the MAC (and
 |> a name), and it would still serve what is requested/taken but
 |> still serves both entries via DNS.
 |> 
 |> Other than that it seems dnsmasq cannot do this for now?
 |
 |OP should come back with an URL of a libpcap file
 |that shows that "alp-2021" is telling "dnsmasq"
 |that it wants to talk IPv6.

Hm.  The thing to me is that hosts.dnsmasq defined entries for
both, IPv4 and IPv6.  It would be great if dnsmasq would treat
this as a request to act authoritative for this, and since it
actually does serve the A, it should act for AAAA, and vice versa.
And if the future would bring the possibility to enforce that
somehow on dhcp-hostfile= base, even if that does _not_ define any
address at all but MAC (and hostname), _that_ would be tremendous.

 |> It is great nonetheless :)
 |
 |;-)

Netmask calcuation alone.

 |Groeten
 |Geert Stappers
 |
 |P.S.   I'm subscribed to this mailinglist.

You can set followup-to-honour or similar to generate
mail-followup-to headers, which then get acted upon.
I blindly hit return button.  I mean i could also list-reply, but
in practice i do not.  Unfortunately m-f-t never became
standardized.

--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