Registering linux hostnames on windows DNS
/etc/nsswitch.conf
containshosts: files dns
which I think means that linux clients can import hostnames from the DNS
The assumption you've made is incorrect. That line indicates how the system will try to lookup the hostname or domain name you've entered. For example when pinging a domain name, or when typing a url in the browser. files
refer's to /etc/hosts
and is where you can manually specify domain to ip bindings. dns
refer's to the DNS servers that are in use by your system. So with your config, if you were to type in ping google.com
the system would look for google.com and an associated ip in files
(/etc/hosts) first, then it would check DNS if it didn't find a match in /etc/hosts
.
When the Windows machines join the domain they become a trusted resource. At the time of joining the domain a DNS record is created for them if that service is installed on the Domain and managed by AD. To allow non-windows machines to register their hostnames in DNS the zone must be configured to allow updates. The non-windows machine also needs to have the correct domain configured in the /etc/hostname
file so that it matches the domain name of your AD environment.
So the final answer was not on the linux-client side at all, but on the DHCP configuration.
On "Windows Server 2016 Standard" I had to do the following to get this working.
- Open the "DHCP" desktop app
- Select the DNS tab
- Expand the node representing your domain
- Right click on "IPv4"
- Select "Properties" from the context menu
- Check "Enable DNS dynamic updates according to the settings below:"
- Select "Always dynamically update DNS records"
- Check "Dynamically update DNS records for DHCP clients that do not request updates"
The results were not immediate. Rebooting machines did not force the update. I made the change on Friday, and by Wednessday all Linux clients seemed to be listed in the DNS.
I was able to confirm the additions by viewing the "DNS Manager" on the same server.