BIND (Berkeley Internet Name Domain) is an implementation of the Domain Name System (DNS) protocols. It might be an overkill, but it can be used to define the names of all machines on a local network.
Emerge BIND the Gentoo way:
emerge search bind
emerge -f bind bind-tools
emerge bind bind-tools
The downloaded components are:
named
dig and host
nslookup (deprecated)
Edit the daemon configuration file /etc/bind/named.conf:
options {
version "Bind"; - Don't disclose real version to hackers
directory "/var/named";
listen-on-v6 { none; };
recursion no;
};
zone "<domainName>"{
type master;
file "named.<domainName>.zone";
notify yes;
};
zone "127.in-addr.arpa"{
type master;
file "pri/127.zone";
allow-update { none; };
};
Edit the IP and name file /etc/bind/pri/<domainName>.zone:
$TTL 1W
@ IN SOA ns.<domainName>. root.localhost. (
2002081601 ; Serial
28800 ; Refresh
14400 ; Retry
604800 ; Expire - 1 week
86400 ) ; Minimum
IN NS ns
localhost. IN A 127.0.0.1
<machine1> IN A 192.168.1.<nn>
<machine2> IN A 192.168.1.<nn>
Start the daemon:
/etc/init.d/named start
rc-update add named default
Add the server in the domain server list of every machine
by editing /etc/resolv.conf.