Setting bind on ubuntu distro, almost the same as setting bind on fedora distro, only the location of the file are slightly different.
In ubuntu we modify the named.conf file and the file db.local, need I remind you here do not change the file db.local without making a copy first.
The second file can be found in the directory /etc/bind
In ubuntu we modify the named.conf file and the file db.local, need I remind you here do not change the file db.local without making a copy first.
The second file can be found in the directory /etc/bind
first step we create a domain name, ie add the domain name you want on the named.conf file as follows:
zone "domain.com" {
type master;
file "/etc/bind/db.domain";
};
save the configuration, and then copy the db.local to db.domain with the following command :
cp db.local[space]db.domain
open the file db.domain with your favorite text editor such as gedit / vi. In db.domain contain alot of configuration code wich is have their own function, few of them :
@ : is a name. On SOA sing with @
IN : is an address class , in this case is INTERNET
SOA : Start Of Authority (is a record type of DNS)
localhost. : is a name server used(localhost is default)
root.localhost : is contact email address
then change the following string:
server IN A 192.168.0.2{your machine ip address}
the sub domain created as the following code :
www IN CNAME server.domain.com
admin IN CNAME server.domain.com
Next you must to set your DNS server by editing the file resolv.conf wich is on /etc directory
Add the following code :
domain domain.com
nameserver 192.168.0.2
Done??
Not yet :(
We must to restart the Bind daemon on /etc/init.d/ bind
/etc/init.d/bind9 restart
Now test the server by typing :
nslookup server
Then test the sub domain alsonslookup www