3

I use /etc/hosts to define names to local addresses in the network, so I can type ssh user@raspberry instead of ssh [email protected].

It works very well for a single machine, but now I need to replicate to many machines. So naturally, a central name server in the server is a better approach, so I configure the machine once and the changes are all made in the server.

The question is: Whats the better way to implement this? I want to to keep it simple, just like using the hosts file, and something like BIND seems to be a little overwhelming. And what the pros and cons of a certain approach?

2
  • Install unbound, bind it to the local interface on your server, and configure all machines to use it. It's a good DNS cache, and it can also act as an authoritative server for your local network. Nor particularly simple, but still a whole lot simpler than bind. Aug 24, 2016 at 19:13
  • Why not install a web panel? Those usually have a very simple DNS configuration interface. Aug 25, 2016 at 4:14

2 Answers 2

6

Dnsmasq will serve up the data in your /etc/hosts file as a dns server - authoritative for your lical domain and providing caching for internet lookups. It also provides a dhcp server.

2

For ssh(1) you would create ~/.ssh/config

host raspberry
  hostname 192.168.0.5
  user user

Then you can just do ssh raspberry

Of course, DNS is the solution for central host database, that is exactly it's function! You don't have to use bind if that sounds too frightening, there are smaller servers like dnsmasq which could do it more easily.

Not the answer you're looking for? Browse other questions tagged .