DNS server : 53

DNS server : 53

Domain name system / service => DNS service is needed for resolving the hostname to IP address.
port
53 udp : dns quries
53 tcp : zone transfer and dns quries

============================================================

configure DNS server

1> check hostname
#hostname
server.skynet.com

2> #iptables -F
#service iptables save

3> #yum install bind -y

4> #vim /etc/hosts ============> local DNS
192.168.122.10 server.skynet.com
:wq

5> #vim /etc/named.conf

listen-on port 53 { 192.168.122.10 ; } ;
allow-query { any ; } ;
or define n/w eg. 192.168.122.0/24
or IP
or none

zone “skynet.com” IN {
type master ;
fine “forward.zone”;
};

zone “122.168.192.in-addr.arpa” IN {
type master ;
file “reverse.zone” ;
};

Note : 122.168.192.in-addr-arpa ====> first 3 octect in reverse order of 192.168.122.10 ]

:wq

——————————————————————————-
Extra : you can check and add this zone entries in file /etc/named.rfc912.zones” also
——————————————————————————-

6> copy forward and reverse zone file syntax
#cd /var/named/
#cp -av named.localhost forward.zone
#cp -av named.loopback reverse.zone

————————————————————————————-
7> # vim /etc/named/forward.zone

$TTL 1D
@       IN SOA sekynet.com. root.skynet.com. (
0       ; serial
1D     ; refresh
1H     ; retry
1W     ; expire
3H )   ; minimum
NS     server.skynet.com.
server.skynet.com.     A       192.168.122.10
www     CNAME   server.skynet.com.
skynet.com.     A       192.168.122.10
@       MX     10     mail.skynet.com.

:wq
————————————————————————————-
8> #vim /etc/named/reserse.zone
$TTL 1D
@      IN SOA skynet.com. root.skynet.com. (
0       ; serial
1D     ; refresh
1H     ; retry
1W      ; expire
3H )   ; minimum
NS     server.skynet.com.
10     PTR     server.skynet.com.
—————————————————————————————

9> #service named restart

10> #chkconfig named on

========================================================================================

Client settings.

1> #vim /etc/resolv.conf
search skynet.com
nameserver 192.168.122.10

:wq

2> #nslookup server.skynet.com
#nslookup 192.168.122.10

[temporary nameserver [NS] address ]

3> #host server.skynet.com => reverse lookup
or
#dig -x server.skynet.com

Graphical
#system-config-network
Or
#setup
======================================================================================

Posted in servers

Leave a Reply