Maintaining `/etc/hosts` for hosts on DHCP

It depends on what is doing the DHCP?

Most home routers use dnsmasq and you can use that as your local DNS server. You just need to set dnsmasq to return itself as the DNS server. Next, you need to make sure that your PCs broadcast a hostname during the DHCP request.

Then, voila, you should be able to resolve all your local machines through the DNS/DHCP server.


Depending on what you want to accomplish, you could set up avahi, which can broadcast the existence of a sshd service on your machine. Be careful in 'foreign' networks though...

Tags:

Hosts

Dhcp