| PeteDotCom -> Networking ->
Linux -> Configuring DNS ->
The following setup is
tailored for slackware version 7. If your Linux is different, please
refer to your manual.
To get started edit
your /etc/hosts file This file describes a number of
hostname-to-address mappings for the TCP/IP
subsystem.
the following is an
example.
192.168.1.12 g1c2.3604e1
g1c2
192.168.1.22 g2c2.3604e1
g2c2
The first part is the ip address
of each address of each host, the second part is the name of each
host, and the last bit is the alias of each host.
Now edit
/etc/host.conf make sure it is like the
following order hosts, bind multi on
Now edit
/etc/named.conf the following is a sample, modify
accordingly
/*
* A simple BIND 8
configuration
*/
options {
directory
"/var/named"; #create
/var/named if necessary
};
logging {
category lame-servers { null;
};
category cname { null;
};
};
zone "3604e1" in
{ #change 3604e1
to the name of your domain
type master;
file
"named.3604e1"; #change this to
named.youdomain
};
zone "1.168.192.in-addr.arpa" in
{ #change this to your network
address
type master;
file
"named.192.168.1"; *modify
accordingly
};
#zone "bar.org" in {
# type slave;
# file "bar.hosts";
# masters { 192.168.1.1;
};
#};
zone "." in {
type hint;
file "named.ca";
};
zone "0.0.127.in-addr.arpa" in
{
type master;
file "named.local";
};
now edit your
/etc/resolv.conf the following is a
sample domain 3604e1 #modify
3604e1 to your domain name
search
3604e1 #same as
above
nameserver
192.168.1.22 #modify to your nameserver
address
now edit your
/var/named/named.192.168.1 create directory
/var/named if necessary also modify the ip address to
what your network is.
@ IN SOA g2c2.3604e1
(
2000100900 ; Serial number
YYMMDD###
43200 ; Refresh frequency: twice
per day
3600 ; Retry rate: refresh each
hour
172800 ; Time to expire: two
days
86400) ; Time to wait: one
day
; Nameservers in our
domain
IN NS g2c2.3604e1
;
; Hosts in the domain
22 IN PTR g2c2.3604e1. ; Master
Server
24 IN PTR
g2c2.3604e1.
(first part (22 & 24) is the
last part of the ip address of the host. followed by IN PTR and then
the host name.)
now edit the
/var/named/named.3604e1 Change this to
named.yourdomain
;Master domain name file for
3612.com
@ IN SOA g2c2.3604e1.
hostmaster.3604e1 (
001023000 ; Serial number
YYMMDD###
43200 ; Refresh frequency: twice
per day
3600 ; Retry rate: refresh each
hour
172800 ; Time to expire: two
days
86400) ; Time to wait: one
day
;nameservers in our
domain
IN NS g2c2.3604e1.
IN MX 10 g2c2.3604e1.
www IN CNAME
g2c2.3604e1.
;services to the other
hosts.
g2c2 IN A
192.168.1.22
g2c4 IN A
192.168.1.24
(modify where
necessary)
now modify
/var/named/named.ca just copy the
following
;
9999999 IN NS
e.root-servers.net
9999999 IN NS
c.root-servers.net
9999999 IN NS
f.root-servers.net
9999999 IN NS
d.root-servers.net
9999999 IN NS
a.root-servers.net
9999999 IN NS
b.root-servers.net
9999999 IN NS
g.root-servers.net
9999999 IN NS
i.root-servers.net
9999999 IN NS
h.root-servers.net
;
; root Name server
addresses.
;
a.root-servers.net 9999999 IN A
198.41.0.4
b.root-servers.net 9999999 IN A
128.9.0.107
c.root-servers.net 9999999 IN A
192.33.4.12
d.root-servers.net 9999999 IN A
128.8.10.90
e.root-servers.net 9999999 IN A
192.203.230.10
f.root-servers.net 9999999 IN A
192.5.5.241
g.root-servers.net 9999999 IN A
192.112.36.4
h.root-servers.net 9999999 IN A
128.63.2.53
i.root-servers.net 9999999 IN A
192.36.148.17
now edit
/var/named/named.local
; Namer service database for the
localhost address.
;
@ IN SOA g2c2.3604e1.
postmaster.3604e1. (
001023000 ; Serial
number
604800 ; Refresh once per
week
86400 ; Retry refresh: each
hour
1209600 ; Expire in two
weeks
1209600) ; Minimum
TTL
;
;nameserver in our
domain
IN NS g2c2.3604e1.
22 IN PTR
g2c2.3604e1.
; End of file
(modify where
necessary)
To see if DNS is
working:
nslookup g2c2
<enter>
it should now show the ip
address of host g2c2
|