Debian – How to make the server use the hosts file to resolve names

debiandnshosts

I have a computer with Debian at home, acting as a server with two Ethernet cards: eth0 connected to the router in DHCP mode and eth1 to a switch (static address) that holds four more computers.

I'm using the PC to be the gateway-firewall of the others. Since I only have four more PCs in the internal network, I don't want to set up BIND on the server. It is easier to use the file hosts to solve the names of the four PCs, but I can't make the server look into the file /etc/hosts. The server has no configuration at all; it's only using the defaults gotten from my ISP. How can I make the server resolve the addresses in the file hosts?

Best Answer

That's because the /etc/hosts is simply a file on your Debian server that it utilizes for its own name resolution.

It doesn't use the file to provide any DNS services.

Since you don't want to set up BIND can I recommend that you look at dnsmasq instead?

It's lightweight and can act as a DNS and DHCP server, simply by making use of your hosts file.

Related Question