Fully qualified domain name in dhcp static leases

so, in the "static leases" tab of /cgi-bin/luci/admin/network/dhcp (or dhcp.@host[1].name= in uci), if I add a host with a fqdn.example.net name then, in /tmp/hosts/odhcpd it'll be written with the ipv6 address and the fqdn.example.net name, but in /tmp/hosts/dhcp.cfg01411c the name will be appended with the dhcp.@dnsmasq[0].domain

The results is that dig aaaa fqdn.example.net @_gateway works fine giving me the local ipv6 address, but dig a fqdn.example.net @_gateway doesn't respond with the local ipv4 address.

The question is: is this intentional and expected? Can I override it?

The idea is that I want to specify fqdn.example.net in the static leases configuration once, and it would be also added to the DNS resolver too.

In the dhcp leases you should use only the hostname.
domain is added for searches automatically.
Should you want to define an fqdn, then do it in Network-Hostnames or with a domain entry in dhcp conf-file.

Alternatively, try ending the fully qualified name with a dot, that should prevent dnsmasq from appending the domain.

I also tried ending the fqdn with a dot, but then in /tmp/hosts/dhcp.cfg01411c it's added as fqdn.example.net..lan :confused:

A third alternative is to add a CNAME from the fqdn.example.net to the localname.lan and use localname in the dhcp static leases.

Should I report this as a issue, bug or request for enhancement? Especially with the double dot thing.

Try to set the option domain=example.net, or remove it completely.

I don't want to change the domain. Just to setup a FQDN alias for a host in static leases.

It should be possible to override the current domain with the following:
https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#hostnames

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.