Configure DNS Server Using Webmin
DNS (Domain Name Server) used for name resolving to any hosts that means it translates domain names into IP addresses. Domain names are alphabetic, they’re easier to remember. The Internet however, is really based on IP addresses. Every time you use a domain name, therefore, a DNS service must translate the name into the corresponding IP address.
In our previous article, you have setup your DNS Server using command line interface, refer below link for more information.
In this article We will seen how to configure DNS Server Using Webmin(web-based interface). Webmin tool offer to new system administrators to perform all system management task from via a web browser, Instead of using the command line console or terminal. You can also manage a system from the console or remotely.
We use 4 systems, One machines as server setup and other three machines as a client machines (Linux as well as window). Let look at below details for more understanding.
DNS server ip address and hostname(Centos7):192.168.1.10 (server1.ittroubleshooter.in)
DNS Client ip address and hostname(Centos7):192.168.1.11 (server2.ittroubleshooter.in)
DNS Client ip address and hostname(RHEL7): 192.168.1.12 (client1.ittroubleshooter.in)
DNS Client ip address and hostname(Window7): 192.168.1.13 (client2.ittroubleshooter.in)
Step by Step configuration of DNS Server Using Webmin
1) Setting up Webmin.
As previous, we have seen how to configure Webmin on Centos/RHEL7 systems, refer below link.
2) Install the package for DNS using Webmin.
After Log into Webmin, First we need to search “BIND DNS Server” and install the Bind DNS Server Packages, refer below screen shots.
After search “BIND DNS Server”, Click on “Click here” option to downloaded the DNS server Packages using YUM. If you are not configured the YUM server, refer the link.(Configure the Yum Server in Centos7/RHEL7/Fedora22)
On Below screenshot, The Bind Packages can be automatically installed by Webmin.
Note: If you already installed the DNS packages, then there is no need to perform above steps. Similarly you Go to Servers, and then click on “BIND DNS Server”.
3) Creating a Forward Master Zone.
Now Go to Servers, then click on “BIND DNS Server” and Click on “Create master zone”.
Enter the domain without the www into the “Domain name / network” box (In our case we are using ittroubleshooter.in domain name). For the master server, type in the domain name as well. You can check the “Create NS record” box then enter your email address in the appropriate box. Type in the IP address of the server and Click “Create” button, refer below screenshot.
On the next Step, You will then be redirected to the Master zone page for that domain you just created. Now you create A records (Address Records) after Click on “Address” options, refer below screenshot.
4) Creating “A” records (Address Records).
Type in “server1” for the name, and type in the “IP address” and Click on “create”, refer below screen shot.
As below screenshot, Address Records has been created.
Similarly, create Address record for remaining systems and the click on “Return to zone list” button.
As you seen below screenshot, the “ittroubleshooter.in” i.e Forward Master Zone has been created. Now, its time to create Reverse Master Zone. Click on “create master zone”.
5) Creating a Reverse Master Zone.
After click on “create master zone”. Select Zone Type Reverse Zone. Enter the domain or network into the “Domain name / network” box (In our case we are using 192.168.1). For the master server, type in the domain name as well. You can check the “Create NS record” box then enter your email address in the appropriate box. Type in the IP address of the server and Click “Create” button, refer below screenshot.
On the next Step, You will then be redirected to the Master zone page for that domain you just created. Now you create A records (Reverse Address Records) after Click on “Reverse Address” options, refer below screenshot.
6) Creating Reverse Address.
Type in the IP address, and type in hostname on “hostname” box and Click on create, refer below screen shot.
As below screenshot, Reverse Address Records has been created.
Similarly, create Reverse Address record for remaining systems and the click on “Return to zone list” button.
As you seen below screenshot, the “192.168.1” i.e Reverse Master Zone has been created.
7) Edit Addresses & Topology options.
On Global Server options, Click on Addresses and Topology.
Enter the port no. and address on port and addresses box respectively, and click on save option(refer below screenshot).
8) Edit Zone Defaults option.
Click on Zone Defaults option, refer below screen shot.
On Defaults zone settings type “any” on “allow queries from..” box.
Configuration of DNS Server is over, now start the Bind service.
9) Allow DNS service on firewall.
[root@server1 named]# firewall-cmd --add-port=53/udp --permanent success [root@server1 named]# firewall-cmd --add-port=53/tcp --permanent success [root@server1 named]# firewall-cmd --reload success [root@server1 named]#
Configure DNS Server on Client (Linux) Side
1) Edit the /etc/resolv.conf file.
Add the DNS server details in “resolv.conf” file in all Client systems.
# Generated by NetworkManager search ittroubleshooter.in nameserver 192.168.1.10 ~ ~ :wq
2) Restart network service.
[root@client1 ~]# systemctl restart network
3) Verify DNS server.
Using dig & nslookup command you can verify the DNS queries. if the commands is not found, you can use bind-utils packages.
[root@server2 ~]# nslookup client2 Server: 192.168.1.10 Address: 192.168.1.10#53 Name: client2.ittroubleshooter.in Address: 192.168.1.13 [root@server2 ~]# dig -x 192.168.1.13 ; <<>> DiG 9.9.4-RedHat-9.9.4-29.el7 <<>> -x 192.168.1.13 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62751 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;18.104.22.168.in-addr.arpa. IN PTR ;; ANSWER SECTION: 22.214.171.124.in-addr.arpa. 38400 IN PTR client2.ittroubleshooter.in. ;; AUTHORITY SECTION: 1.168.192.in-addr.arpa. 38400 IN NS server1.ittroubleshooter.in. ;; ADDITIONAL SECTION: server1.ittroubleshooter.in. 38400 IN A 192.168.1.10 ;; Query time: 2 msec ;; SERVER: 192.168.1.10#53(192.168.1.10) ;; WHEN: Fri Oct 07 01:19:34 EDT 2016 ;; MSG SIZE rcvd: 133 [root@server2 ~]#
Configure DNS Server on Client (Window) Side
In our case we are using window 7 machine.First go to start–> run–> type “ncpa.cpl”. Select the network adapter and go to properties.It will popup the new window,Select the “Internet Protocol Version 4” option and click on properties, refer below screen shot.
Fill the entries on preferred DNS server, refer below screen shot.
Use nslookup command you can verify the DNS queries, refer below screen shot;
Hope this post will help Linux/Unix beginners. Please share you feedback and Comments.!!!