How do I register DHCP linux client's hostnames in a windows server DNS?
I have a small-business mixed network with:
- DCHP Windows workstations (Example hostname:
win1
)- About 10 machines
- Machines are on the domain, no special config.
- DHCP Linux (Debian stretch) workstations (Example hostname:
lin1
)- About 20 machines
- Connected to domain with
sssd
usingrealm join
- Can use AD credentials on any machine
/etc/nsswitch.conf
containshosts: files dns
which I think means that linux clients can import hostnames from the DNS
- DHCP/DNS server running Windows Server at a static IP
From any machine I can ping win1
, but can't ping lin1
which tells us:
- all machines use the DNS fine (can ping
win1
) - windows hostnames are automatically registered
- linux hostnames are not automatically registered
Rejected solutions:
hosts
: We don't have static IPs so I'm not going to manually maintain a master copy of thehosts
file and distribute it whenever a new DHCP lease is issued.- Adding
A
records to DNS: Again, I don't want to manually update records when new DHCP leases are issued. avahi
: The windows clients can't see the linux ones.
Things I haven't tried:
likewise
: I'd rather not abandonsssd
and reconfigure all 20 machines from scratch like this. But iflw-register-dns
would solve the problem and wouldn't conflict withsssd
, then that could be a solution. Still find it weird that clients would need to create a cron-job to modify the DNS, I optimally want to limit DNS write-access.winbind
, also seems to replacesssd
completely. I tried the linked suggestion, but saw no differences after restarting the client's networking service.nmbd
. The workstations already usesmbclient
, do they really need to become full-fledged samba servers too?net ads dns register -P
. I'll need to get access to the DNS to enable insecure updates.
Best Answer
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 inping google.com
the system would look for google.com and an associated ip infiles
(/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.