Setting up a dns server

Setting up a dns server


Author: anonymous

System Architecture: All/General
RedHat Release: All/General
FAQ Category: Networking and netcfg
Modification Date: Jan 20, 1999

Question:

If you want to setup a local dnsserver. You can use these files.
This works for Redhat 5.0 en 5.1. When using RedHat 5.2 you will have
to use the named-bootconf.pl script to convert you /etc/named.boot file to a
proper /etc/named.conf file.
Syntax: named-bootconf.pl /etc/named.boot > /etc/named.conf

I assumed that during installation you gave your machine the name ns.notreal.com,
otherwise you should replace ns.notreal.com in the example below to something that 
fits you configuration. I also assumed that you machine's IP address is 192.168.2.1

Answer:

/etc/named.boot

;
; a caching only nameserver config
;
domain                                  notreal.com
directory                               /var/named
cache           .                       named.ca
primary         0.0.127.in-addr.arpa    zone/127.0.0
primary         2.168.192.in-addr.arpa  zone/192.168.2
primary         notreal.com              zone/notreal.com
forwarders      194.158.160.10 194.158.160.14

;       These are here to avoid silly
;       queries to higher level servers.
;
primary         0.IN-ADDR.ARPA          0
primary         255.IN-ADDR.ARPA        255

/var/named/zone/127.0.0

@       IN      SOA     ns.notreal.com. root.notreal.com.  (
                                       1998101380 ; Serial
                                       28800      ; Refresh
                                       14400      ; Retry
                                       3600000    ; Expire
                                       86400 )    ; Minimum
                NS      ns.notreal.com.
1               PTR     localhost.

/var/named/zone/192.168.2

@       IN      SOA     ns.notreal.com. root.notreal.com.  (
                                      1998101380 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
                NS      ns.notreal.com.

1               PTR   notreal.com.

/var/named/zone/notreal.com

@       IN      SOA     ns.notreal.com. root.notreal.com.  (
                                      1998101380 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
                NS      ns.notreal.com.
hapkido.nl.     MX      0 mail.notreal.com.

localhost.      A       127.0.0.1
ns.notreal.com.  A       192.168.2.1

mail            CNAME   ns.notreal.com.
ftp             CNAME   ns.notreal.com.
www             CNAME   ns.notreal.com.

/var/named/0

;
;       0.in-addr.arpa
;
;       1.1   910522
;       2.0   19980106
;
@               IN      SOA     ns.notreal.com.  root.notreal.com. (
                                1998101380      ; Serial
                                28800           ; Refresh
                                14400           ; Retry
                                3600000         ; Expire
                                86400 )         ; Minimum
@               IN      NS      ns.notreal.com.

/var/named/255

;
;       255.in-addr.arpa
;
;       1.1   910522
;       2.0   19980106
;
@               IN      SOA     ns.notreal.com.  root.notreal.com. (
                                1998101380      ; Serial
                                28800           ; Refresh
                                14400           ; Retry
                                3600000         ; Expire
                                86400 )         ; Minimum
@               IN      NS      ns.notreal.com.
------------------------------------------------------------------------------
/etc/HOSTNAME

ns.notreal.com

References:

the howto's