What is Linux DNS Server ?

 

DNS Server What is

 

  • Domain Name System (DNS) converts the name of a name (example: ithelpblog.com) to an IP address (28.33.23.67).
  • A DNS client doesn’t store DNS information; it must always ask  a DNS server to get it. The only DNS configuration file for a DNS client on Linux is the /etc/resolv.conf  that defines the IP address of the DNS server.
  • BIND (Berkeley Internet Name Domain) which is a project that maintains the DNS-related software suite that runs under Linux. The most well known program in BIND is named service.
  • Linux version of DNS is the named, which is based on BIND, which powers most of the DNS Servers on Internet.
  • DNS Server can not hold all FQDN and IPv4 addresses on Internet. If a DNS server does not have a FQDN in its database, it can refer to other DNS servers. Once the server finds the right IP address, it adds the FQDN and IP address to its database.

Basic Knowledge about Bind DNS Server

  • DNS is configured thought /etc/named.conf and /etc/named.custom, detailed configuration files in /var/named (domain database)
  • Packages for Bind DNS
    • bind-* : DNS name server software.
    • bind-utils-* : DNS tools such as: dig, host …
    • caching-nameserver-* : basic configuration for caching dns server, includes /etc/named.conf and /var/named/localhost.zone files.
    • redhat-config-bind-* : Redhat GUI DNS configuration tool.
  • DNS servers are organized in zones. Each dns servers has its zone of responsibility. DNS zones are based on the way FQDNs are organized.
  • A master DNS server on ithelpblog.com, network would be the authoritative server for that zone. Conversely, ithelpblog.com, is the Forward Master Zone for that DNS Server.
  • We also should be able to find an IP address from a FQDN – you we should have reverse process to find a FQDN from IP address. The reverse database is known as a Reverse Master Zone.
  • We are having 4 types of DNS Servers.
    • Master : the master DNS is authoritative server for a specific zone, such as ithelpblog.com. Queries for IP address from computers on ithelpblog.com normally will go to this Master server. Other DNS servers will refer to this master IP address and computers within ithelpblog.com.
    • Slave : Queries for IP addresses within ithelpblog.com go to this server, it gets its FQDN / Ip address database from Master.
    • Caching-only : it will store recent requests for IP Addresses. It will help quicker answer by using caching-only DNS server. The default /etc/named.conf file is designed for a caching-only nameserver that’s connected to Internet.
    • Forwarding : A Forwarding DNS server does not store any FQDN / IP address information. It will store IP address of other DNS server in /etc/named.conf.
  • Several configuration files are required for a DNS server: /etc/named.conf, /etc/named.custom, and database files in /var/named directory. It is the best to edit these files directly with the text editor of your choice.
    • sysconfig/named : if you want to setup dns configuration files in nonstandard location.
    • named.conf : basic dns configuration file.
    • named.custom : If you use redhat-config-bind, you can use this file to add more DNS settings.
    • rndc.key : authentication key that supports DNS requests, configured in /etc/rndc.conf. We can setup a key by this command with key size of 512 bits.
      • rndc-confgen -a -b 512
  • Localhost Zone files.

localhost-zone

 

    • $TTL : length of time for which the data in this file is good. Default is seconds.
    • $ORIGIN : Allows us to list hostnames that may not correspond to the FQDN for that computer. Otherwise, our DNS server would assume this computer’s FQDN is localhost.ithelpblog.com.
    • @ : Adds the $ORIGIN commands or domain specified in /etc/named.conf.
    • IN : Notes a standard data record.
    • SOA : Start of Authority, specified key information about this database.
    • @ root : Messages are sent to root user on localhost computer.
    • Serial Number : Serial number associated with this file.
    • Refresh : the time between checks to the primary DNS server for this zone, in seconds.
    • Retry : Sets time to try contact a DNS server if the first attempt fails.
    • Expiry : a stop time, If refresh and retry attempts don’t reach a DNS server; stop activity on this zone after this much additional time. (seconds).
    • Minimum : sets a minimums TTL for data.
    • NS : set nameserver for this data.
    • A : address record.
  • Starting and Test our DNS server
    • /etc/init.d/named start
    • host -l ithelpblog.com
    • dig ithelpblog.com
  • Using DNS client
    • We can configure DNS client at /etc/resolv.conf

 

Thanks for using IThelpblog.com.

 

 

Leave a Reply

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

Go to top