Adding Domain to DNS Server:
Every system in a network have an IP address and it is unique address of that particular machine. Similarly the website also has IP address but it is not used. Websites are referred by their names like google.com or facebook.com. It is very hard to remember IP addresses for every websites. That’s why DNS is used for translating the website names into IP address.
DNS server is a type of server that manages and maintains the domain names and it contains the database of the IP address and their corresponding records. The DNS translate domain names into its IP address. The well-known version of the domain name is BIND, it is free and it comes with Linus/Unix systems. It is an open source software used for implementing the DNS protocols and it has an ability for translating the website names into IP address.
For adding new domain to DNS Server two files that are related to DNS server has to be edited.
An Entry is added to Named.config:
DB Record Creation:
"/var/named/example.com.db is the path of the DB record and MX records, Address records and all records that are related to the example.com can be added.
Every system in a network have an IP address and it is unique address of that particular machine. Similarly the website also has IP address but it is not used. Websites are referred by their names like google.com or facebook.com. It is very hard to remember IP addresses for every websites. That’s why DNS is used for translating the website names into IP address.
DNS server is a type of server that manages and maintains the domain names and it contains the database of the IP address and their corresponding records. The DNS translate domain names into its IP address. The well-known version of the domain name is BIND, it is free and it comes with Linus/Unix systems. It is an open source software used for implementing the DNS protocols and it has an ability for translating the website names into IP address.
For adding new domain to DNS Server two files that are related to DNS server has to be edited.
An Entry is added to Named.config:
- SSH, root is logged in.
- In any text editor, file /etc/named.conf is opened.
- Zero entry for the example.com is added in the end of the file in the following format
Code:
zone "example.com" {
type master;
file "/var/named/example.com.db";
};
"/var/named/example.com.db is the path of the DB record and MX records, Address records and all records that are related to the example.com can be added.
- To edit the text editor, /var/named/example.com.db file is opened.
- The contents can be copied and pasted as given below. Each and every records can be edited as per the need of the domain. Here the IP address 10.10.10.10 should be replaced by the domain IP address.
Code:
; Zone file for example.com
$TTL 14400
example.com. 86400 IN SOA ns1.example.com. host.example.com. (
2012031401 ;Serial Number
86400 ;refresh
7200 ;retry
3600000 ;expire
86400 ;minimum
)
example.com. 86400 IN NS ns1.example.com.
example.com. 86400 IN NS ns2.example.com.
example.com. 14400 IN A 10.10.10.10
localhost 14400 IN A 127.0.0.1
example.com. 14400 IN MX 0 example.com.
mail 14400 IN CNAME example.com.
www 14400 IN CNAME example.com.
ftp 14400 IN CNAME example.com.
webmail 14400 IN A 10.10.10.10
- The text editor is saved and exited.
- The below command is used for reloading the DNS server
Code:
rndc reload