NetworkConfiguration / dhcpcd

DHCP / IPv4LL / IPv6RA / DHCPv6 client.
https://roy.marples.name/projects/dhcpcd
BSD 2-Clause "Simplified" License
348 stars 112 forks source link

RFC9463 DNR: DHCP options 144 and 162 for DoH/DoT/DoQ #341

Open westurner opened 4 months ago

westurner commented 4 months ago

Support for RFC9463 DNR: DHCP options 144 and 162 for DoH/DoT/DoQ

RFC9463 "DNR" allows DHCP servers to indicate to clients that there are encrypted DNS resolver settings to use.

"RFC9463: DHCP and Router Advertisement Options for the Discovery of Network-designated Resolvers (DNR)" https://datatracker.ietf.org/doc/html/rfc9463

144     OPTION_V6_DNR
162     OPTION_V4_DNR

The encoding is similar to DHCPv6 options FWIU:

"Update DNR implementation and docs to be inline with RFC 9463" https://gitlab.isc.org/isc-projects/kea/-/issues/3141 :

send each key=value encoded as key-type (2 octets), len (2 octects), value (variable)

This is basically a very similar encoding to DHCPv6 options. Sadly, there's a list of defined keys with values and some keys (e.g. port conveying uint16) is encoded on 2 octet

I just sent an email to dnsmsq-discuss about this.

Are there already discussions of adding RFC9463 DNR support to [dhcpcd,]?

Does dhcpcd need to parse the options or is that for downstream apps like [nmcli,] to implement instead of e.g. json?

rsmarples commented 3 months ago

Does dhcpcd need to parse the options or is that for downstream apps like [nmcli,] to implement instead of e.g. json?

dhcpcd-definitions.conf updated so that the option can be exposed via environment variables. Then either 20-resolv.conf or a new hook script can be written to do something with the variables.