The Domain Name System (DNS) is the phonebook of the Internet. Humans access information online through domain names, like nytimes.com or espn.com. Web browsers interact through Internet Protocol (IP) addresses. DNS translates domain names to IP addresses so browsers can load Internet resources.
Each device connected to the Internet has a unique IP address which other machines use to find the device. DNS servers eliminate the need for humans to memorize IP addresses such as 192.168.1.1 (in IPv4)
How does DNS Work
The process of DNS resolution involves converting a hostname (such as www.example.com) into a computer-friendly IP address (such as 192.168.1.1). An IP address is given to each device on the Internet, and that address is necessary to find the appropriate Internet device - like a street address is used to find a particular home. When a user wants to load a webpage, a translation must occur between what a user types into their web browser (example.com) and the machine-friendly address necessary to locate the example.com webpage.
In order to understand the process behind the DNS resolution, itâs important to learn about the different hardware components a DNS query must pass between. For the web browser, the DNS lookup occurs "behind the scenes" and requires no interaction from the userâs computer apart from the initial request.
Configuration
DNS Server
Install Package
sudoyuminstallbindbind-utils-y
Configure DNS
sudo vi /etc/named.conf
## Add on line 12options{listen-onport53{127.0.0.1; 192.168.8.100; }; ## your ip addresslisten-on-v6port53{::1; };directory"/var/named";dump-file"/var/named/data/cache_dump.db";statistics-file"/var/named/data/named_stats.txt";memstatistics-file"/var/named/data/named_mem_stats.txt";recursing-file"/var/named/data/named.recursing";secroots-file"/var/named/data/named.secroots";allow-query{localhost; 192.168.8.100;}; ## your ip address## Add on line 43pid-file"/run/named/named.pid";session-keyfile"/run/named/session.key";forwarders{192.168.8.1; ## your gateway8.8.8.8;8.8.4.4; };## Add on line 64zone"centosrizwan.com"IN{typemaster;file"/var/named/db.centosrizwan.com"; ## your db.fileallow-update{none; };};zone"100.8.168.in-addr.arpa"IN{typemaster;file"/var/named/db.100.8.168"; ## your db.fileallow-update{none; };};