install the dns server and dhcp server with this command:
Code:
sudo apt-get install bind9 dhcp3-server
in the file /etc/bind/named.conf.options
change this line
Code:
forwarders {
192.168.1.1;
};
*change 192.168.1.1 to your isp's (or your routers) dns server (or servers)
in the file /etc/bind/named.conf.local
you have to declare your zones - both the forward zone and reverse zone
Code:
zone "example.com" {
file "/etc/bind/zones/example.com/forward";
type master;
};
zone "1.168.192.in-addr.arpa" {
file "/etc/bind/zones/example.com/reverse";
type master;
};
you can put the zone files anywhere readable by the bind user/group (i.e. - under the /etc/bind/ folder would be alright)
then you make your zone files like this:
forward zone
Code:
$TTL 86400
@ IN SOA name.of.nameserver. email.address.hotmail.com (
2008050900 ; Serial (can be anything (use date+serial) increment when you change the file
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
;
@ IN NS name.of.nameserver
@ MX 10 name.of.mailserver
name.of.nameserver A 192.168.1.1
comp2 A 192.168.1.2
alternativename CNAME comp2
outside CNAME finish.outside.domains.with. ;finish outside domains with a period
reverse zone:
Code:
1.168.192.in-addr.arpa IN SOA name.server. email.address. (
2008050900 ; serial
604800 ; refresh (1 week)
86400 ; retry (1 day)
2419200 ; expire (4 weeks)
86400 ; minimum (1 day)
)
NS nameserver.example.com. ; don't forget the dot at the end
1 PTR nameserer.example.com.
2 PTR comp2.example.com
and, unless i did something really wrong, that should work.
just change the /etc/resolv.conf to say:
Code:
search example.com
nameserver ip.of.dns.server
test it with nslookup (enter a bunch of domains (ex: google.com) and your local domains (ex: comp2)
or, try
dig comp2.example.com
and dig -x ip.address