
Implementing Domain Name System (DNS) is one of the most difficult task. As a prerequisite for mastering DNS, you need proper lab setup and thorough understanding of theoretical concepts about DNS. In Section 1, we are covering how to setup DNS Lab. Section 2 will deal with various DNS theoretical concepts. In Later sections, practical implementation details are covered.
How to setup the Domain Name System (DNS) Lab.
Prepare a master dns lab by provisioning centos 7 vms, cloning dns-master, dns-slave, dns-client, setting hostnames, disabling firewall and selinux, and installing bind and utilities with a static 172.24.0.1.
Set the hostname to slave.example.com, disable selinux and firewall, configure a static ip 172.24.0.41 with 255.255.0.0, switch from nat to bridge, update the hosts file, and install bind, bind-utils, and httpd, then test connectivity.
DNS is used for name resolution. What do you mean by forward resolution and reverse resolution.
What do you mean by TLDs (Top Level Domains).
What do you mean by domain structure.
What are 3 different categories under DNS Namespace.
What are different types of name servers. What is the purpose of master, slave and caching only servers.
What are different types of queries. How iterative query works.
How recursive query works.
How hybrid query works.
How to configure master DNS server.
Explore key BIND DNS files, such as named.rfc1912.zones and named.ca, view zones like localhost and loopback, and learn A and AAAA records, IPv4 and IPv6 addresses for root servers.
Explore the global options in BIND DNS, including allow-query, allow-transfer, directory and rootdir behavior, forwarders and forward only, allow-recursion, listen-on, and blackhole.
Copy named.localhost to the forward file in the master DNS, then create, edit, and copy the zone file as reverse, while navigating /var/named and chroot considerations.
Learn how a DNS query works: a client asks for www.example.com, the server reads named.conf to locate example.com and uses the forward file to reach the master A record 172.24.0.1.
Create the reverse zone by copying forward, editing with vi, setting master.example.com dot and a PTR record, save, then use ls -l and chgrp named to ensure proper ownership.
Set up a master dns server on 172.24.0.1 with bind and bind-utils. Configure named.conf, create forward and reverse zones for example.com and 172.24.0.0, then test with host, nslookup, and dig.
Configure an Apache web server on the master DNS system, create a sample index.html in /var/www/html, set ServerName to 172.24.0.1 for test deployment, and start the httpd service.
Edit /etc/resolv.conf to test dns from the client, verify 172.24.0.1 on port 53 with nslookup, then use elinks to browse http://www.example.com and ftp://download.example.com, confirming www is aliased to master.example.com.
Learn to verify master-slave DNS transfers by viewing logs in /var/log with tail, identify AXFR full transfers and IXFR incremental updates, and track serial numbers via SOA.
Modify master DNS zone files: update forward and reverse records, increase the serial, add an A for 172.24.0.11 and a PTR for 11 to client.example.com, then reload DNS and verify.
Explore testing a dns server with host -t options, nslookup, and dig to query ns, mx, soa, a, and ptr records and verify reverse resolutions.
Modify the dns forward file in /var/named with vi to add two www a records with ttl 0 for round-robin dns, then restart named and verify with nslookup and dig.
Implement a web server on master and slave, configuring httpd with ServeName and listening addresses, restarting services, and testing with host and nslookup while considering round-robin DNS caching.
Verify or install tree, create /var/www/html/example1, /var/www/html/example2, /var/www/html/example3 with index.html, then configure named based virtual hosting on 172.24.0.1 by setting ServerName and DocumentRoot for each site, and restart httpd.
configure named.conf and forward files to set up three zone files for example1.com, example2.com, and example3.com; copy forward as example1, example2, example3, adjust permissions, and verify dns in /var/named.
Master and test name based virtual hosting with BIND DNS by configuring resolv.conf, querying multiple domains with host, and confirming all resolve to the same IP 172.24.0.1.
Learn how to implement IP-based virtual hosting with DNS by mapping www.example1.com, www.example2.com, and www.example3.com to 172.24.0.1, 172.24.0.2, and 172.24.0.3, and configure Apache accordingly.
Edit httpd.conf to implement ip based virtual hosting with virtualhost entries for 172.24.0.1, 172.24.0.2, and 172.24.0.3, with document roots, then restart; dns resolves example1.com, example2.com, and example3.com to these ips.
Configure ip based virtual hosting by editing /etc/httpd/conf/httpd.conf, assigning ip addresses 172.24.0.1, 172.24.0.2, and 172.24.0.3 to each virtual host, and restart httpd.
Verify named.conf and group permissions, create zone files for example1.com, example2.com, and example3.com, adjust A records to 172.24.0.1 and related IPs, then restart named and httpd.
Verify IP based virtual hosting by inspecting resolv.conf and using elinks, host, ping, and nslookup to confirm multiple site resolutions, demonstrating the DNS role in IP based hosting.
Test split namespace from client c11 using host, nslookup, dig, elinks, and ping to verify the DNS server resolves to 172.24.0.1.
Verify dns and routing on the c31 system by checking hostname, dnsdomainname, resolv.conf, ip route show with head -1, and use host, nslookup, and dig to confirm 10.0.0.31 and 10.0.0.1.
Test the split namespace from client c31, verifying hostname, domain, and DNS settings with host, nslookup, dig, and ping. Demonstrates DNS views delivering client-specific responses.
Configure the postfix mail server by backing up main.cf, editing with vim to set hostname, domain, inet_interfaces, mydestination, and masquerade_domain, and prepare dovecot integration.
Backup Current Repository Configuration:
First, make a backup of your current repository configuration files.
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
Edit the Repository Configuration:
Open the CentOS-Base.repo file in a text editor. (vi or nano)
nano /etc/yum.repos.d/CentOS-Base.repo
Update the Base Repository URLs:
Replace the existing base repository URLs with the URLs pointing to the CentOS Vault. The updated configuration should look something like this:
[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=http://vault.centos.org/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Save the Changes:
Save the changes and exit the text editor (Ctrl+X, Y, Enter for nano).
Clean YUM Cache:
Clean the YUM cache to ensure it uses the updated repository configuration.
yum clean all
yum makecache
Update the System:
Now you can update your system using the Vault repositories.
yum update
This should allow you to continue using yum with the archived CentOS 7 repositories.
DNS (Domain Name System) is critical component of networking. But very few persons are capable of handling DNS properly. This course will start from basic and slowly and slowly will takes you towards advanced concepts. For this course, we are using CentOS 7 Linux distribution and implementing BIND DNS Server.
This course will cover:
- How to configure Master DNS Server
- How to configure Slave DNS Server
- How to implement Round Robin DNS Server
- How to configure Split View (Split Brain)
- How to implement Named Based Virtual Hosting
- How to implement IP Based Virtual Hosting
- You will learn how to implement DNS server in a Linux Environment. Different Scenarios will be discussed.
- How to setup the different labs required for this course has been covered.
- How to test DNS Server using host, nslookup and dig utilities.
- How the communication between master and slave DNS Server works.
- What are resource records, zone files and types of queries will be covered.
We will be combining various servers with DNS Server:
- Using Apache Web Server with DNS to implement Named based and IP based virtual hosting.
- Use VSFTPD (Very Secure File Transfer Protocol Daemon) server with DNS
- How to configure Postfix Mail Server (Simple Mail Transfer Protocol)
- How to configure Dovecot (Post Office Protocol, Internet Messaging Application Protocol)
- How to configure DNS Server for implementing Mail Server
- How to configure SquirrelMail for web access.