Home arrow Configure arrow Name Server
Name Server PDF
Monday, 05 December 2005
1)Run make-localhost from /etc/namedb to generate /master/localhost.rev

2) Generate rndc.key file:

#rndc-confgen -a

3) Write in named.conf the following:

#you should use 127.0.0.1 instead of localhost
server 127.0.0.1 {
keys "rndc-key";
};

#this you should copy from your rndc.key file
key "rndc-key" {
algorithm hmac-md5;
secret "FSrnikY4eK+xxsIamB0fEQ==";
};

controls {
inet 127.0.0.1 allow { localhost; }
keys { "rndc-key"; };
};

4)Restart named server (you can use kill -HUP or you can kill it and start it again)

5) Run #rndc reload

6) Run  #rndc status. You should see sometihing like this:
number of zones: 2
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/1000
tcp clients: 0/100
server is up and running

To setup a domain (for example example.org) on your nameserver:

Write in named.conf:

zone "example.org" {
type master;
file "example.org";
};

This indicates that the zone is master and the info about this zone is found in the file example.org.

Create zone file example.org and insert the followings:

$TTL 3600

#ns1.example.org is set the primary nameserver for the zone
#admin.example.com is the email of the responsible person for this zone (the first "." will be replaced with "@")
#the serial is a random number that has to be changed every time you modify the zone file (usualy the date format is prefered)
example.org. IN SOA ns1.example.org. root.example.org. ( 
2005120500 ; Serial
10800 ; Refresh
3600 ; Retry
604800 ; Expire
86400 ) ; Minimum TTL

; DNS Servers
@ IN NS ns1.example.org.
@ IN NS ns2.example.org.

; Machine Names
localhost IN A 127.0.0.1
ns1 IN A 3.2.1.2
ns2 IN A 3.2.1.3
mail IN A 3.2.1.10
@ IN A 3.2.1.30

; Aliases
www IN CNAME @

; MX Record
@ IN MX 10 mail.example.org.

#rndc reload
Last Updated ( Monday, 05 December 2005 )
 

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?