Loading...
Advance Linux

Dns Server

  • The Domain Naming System is the way in which a URL or domain like www.webnoidschools.com is converted to an IP address.
  • Domain Name System, provides resolution of names to IP address and IP address to Names.
  • Defines a hierarchical name space where each level of the name space is separated by a ” . ” .
  • Top level domains classified into two types.
    • Organizational: Based on purpose or function of the domain
    • Geographical: Based on physical location
  • All the root domains are maintained by IANA.
  • Secondary level domains are maintained by own level by own levels like yahoo, rediff.

Host File:

  • It provides resolution of Hostnames to IP address.
  • It can only resolve the name provide in the local host file.
  • You can add the name and IP address in /etc/host file but we should have to maintain it all the system in the N/W.

The /etc/resolv.conf File:
This file is used by DNS clients to determine both the location of their DNS server and the domains to which they belong.

  • Nameserver: IP address of your DNS nameserver. There should be only one entry per ‘nameserver’. If there is more than one nameserver, you’ll need to have multiple ‘nameserver’ lines.
  • Domain: The local domain name to be used by default. if the server is support.webnoidschools.com , then the entry would just be webnoidschools.com
    Example: #nameserver 192.186.1.254

The Zone Files:

  • In all zone files, you can place a comment at the end of any line by inserting a semi-colon “.” character then typing in the text of your comment.
  • By default, your zone files are located in the directory “/var/named“.
  • Zone: Zone is a storage database which contains all zone records.
    Two type of zone records are available.
    • (a) FLZ (Forward Lookup Zone): Used for resolving host name to IP address.
      It maintains host to IP address mapping information.
    • (b) RLZ (Reverse Lookup Zone): Used for resolving IP address to host name.
      It maintains IP address to host mapping information.
  • Each Zone file contains a variety of records (Example: SOA, NS, MX, A and CNAME)

SOA (Start Of Authority): The very first record is the start of Authority record which contains general administration about the domain.

NS (Name Server): The NS resource record identifies all name servers that can perform name resolution for the zone.
OR
Lists the name of the nameserver for the domain.

A (Address): This record resolves from host name to IP address.

PTR (Pointer): This record resolves from IP address to host name.

CNAME (Canonical Name): Provide additional alternate “alias” names for servers listed in the “A” record.

MX (Mail Exchange): Lists the mail servers for your domain

Requirements:

Packages:

bind*……………………………… rpm
Caching*…………………….. rpm

Port no : 53-DNS
Service : named
configuration files:


/etc/named.caching_name.conf
/etc/named.rfc1912.zones

Zone file location:

/var/named/chroot/var/named

Configuration:

Install the packages:

#rpm -ivh bind* caching* –force -aid
#yum install bind* caching*

Configure the hostname

#vi/etc/sysconfig/network
Hostname = webnoidschools.com
#vi /etc/hosts
192.168.1.254 support.webnoidsvhools.com

Open the first configuration file

#vi /etc/named.caching_nameserver.conf
options {
listen_on port 53 { 127.0.0.1; 192.168.1.254;} ; # Line no: 15
allow_query {localhost; 192.168.1.0/24 ; } ; #Line no: 23
match_clients {localhost; 192.168.1.0/24 ; } ; #line no: 32

Open the second config file:

#vi /etc/named.rfc 1912.zones

Go to last line:

zone “webnoidschools.com” IN {
type master;
file “webnoidschools.com;
allow-update { none; } ;
};
zone “1.168.192.in.addr.arpa” IN {
type master;
file “webnoidschools.rev” ;
allow-update { name ; };
};

Go to zones Location:

#cd /var/named/chroot/var/named

Configuration the FLZ:

#cp localhost.zone webnoidschools.for
#vi webnoidschools.for
$ TTL 86400
@ IN SOA support254.wisdom.com. root.webnoid.com(
42 ; Serial
3H ; Refresh
15m ; Retry
1w ; Expiry
1D ; Minimum
IN NS station.webnoidschools.com
Support IN A 192.168.1.254
Support IN A 192.168.1.240
www IN A support [Apache webserver name]

Configuration thee RLZ:

#cp named.Local webnoidschools.rev
#vi webnoidschools.rev
$TTL 86400
@ IN SOA support.webnoidschools.com. root.webnoidschhols.com.(
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400) ; Minimum
IN NS support.webnoidschools.com
254 IN PTR support
240 IN PTR support

Change the owner

Leave a Reply

Your email address will not be published. Required fields are marked *