
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.
Configure the client for dns testing by using hostnamectl to set hostname to client.example.com, disable firewalld and NetworkManager, and reboot. Apply static 172.24.0.11, update hosts, and install bind-utils.
Verify the client system in a bind dns setup by confirming static ip 172.24.0.11, hostname client.example.com, domain example.com, and verifying bind-utils availability and connectivity to master 172.24.0.1.
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.
Configure the master dns server by verifying prerequisites, checking ip address, hostname, dnsdomainname, and confirming key files like /etc/named.conf, named.rfc1912.zones, and /var/named, along with bind and bind-utils packages.
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.
Verify the essential DNS files /etc/named.conf, /etc/named.rfc1912.zones, and /var/named/named.ca, explore root servers and reverse zones, and note back up and listen-on settings for a master DNS server.
Back up named.conf with cp, edit with vi using dd to remove lines, set listen 172.24.0.1 and allow 172.24.0.0/16 queries, and create forward and reverse zones for example.com and 172.24.0.0/16.
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.
Master the creation of forward and reverse zone files for example.com by copying the existing named.localhost template in /var/named, editing with the proper named group, and avoiding common syntax errors.
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.
Create a forward zone file in bind dns, detailing the start of authority record, fqdn with dot, serial, refresh, retry, negative cache, mx and a records, plus common aliases.
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.
Start and permanently enable the named server using systemctl, differentiating temporary starts from enabling on reboot, and verify the service after setup.
Configure and test the dns resolver on the master server by editing /etc/resolv.conf to set search and name server parameters (including 172.24.0.1), then verify hostname resolution using the host command.
Learn how to test DNS with host, nslookup, and dig, which read the resolver file (/etc/resolv.conf), resolve names to IP addresses, show aliases, and report query time.
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.
Enable and verify the vsftpd ftp server, start it temporarily and permanently, and ensure installation with rpm -q vsftpd, preparing to test dns and ftp together in the next video.
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.
Demonstrate testing a dns server from a client by verifying resolv.conf and using nslookup, host, and dig to resolve www.example.com, check named.conf and zone files for forward and alias records.
Configure a master-slave dns setup by editing the master's forward and reverse zone files, adding two ns entries, two mx records and a records, then test with host and nslookup.
Modify master zone files by updating forward and reverse records to add a slave NS, MX, and A entry, restart named, and verify with host and nslookup.
Configure a slave DNS server by verifying bind and bind-utils, backing up named.conf, editing it to add slave zones for example.com and its reverse, pointing to master 172.24.0.1, validating permissions.
Start the slave DNS server by enabling named and starting the service, verify forward and reverse zone files in /var/named/slaves, and update resolv.conf to point to the correct DNS server.
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.
View log files on the slave and master DNS servers by restarting named and tailing /var/log/messages to monitor IXFR and serial numbers of incremental transfers.
Configure the client with 172.24.0.1 and 172.24.0.41 in /etc/reslov.conf, test with nslookup, then stop the master (systemctl stop named) to verify the slave handles queries and restart the master.
Demonstrates verifying master and slave dns through a client: configure resolv.conf, run nslookup, stop the master, verify slave takes queries, and resume master to confirm failover.
Explore how to use nslookup in interactive mode to query A, MX, NS, and PTR records for example.com, reveal master and slave servers, name servers, and reverse dns details.
Explore the DNS dig utility, learn to query with @server and type (A, NS, MX, PTR), switch between master and slave servers, use +short outputs, and perform zone transfers (AXFR).
Demonstrate using dig to query dns records such as A, MX, NS, and SOA, use +short, contact master or slave servers, perform reverse lookups, and verify zone transfers.
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.
Stop slave DNS service, modify named.conf on the master to implement round-robin using an acl named mylab and a 172.24.0.0/16 network, and configure allow-query and allow-transfer for example.com.
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.
Verify round-robin DNS from the client using nslookup and host, noting varying results due to cache and utility differences, while implementing server-side changes and required entries.
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.
Configure and test web servers on master and slave by creating index.html files, setting ServerName, and restarting httpd, then verify with nslookup.
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 to host three zones for example1.com, example2.com, and example3.com as masters, with zone files; copy and customize forward files in /var/named, then adjust permissions and edit each zone.
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.
Edit zone files step by step to configure soa records, set master as the name server, define the a record 172.24.0.1, and make www subdomains resolve to this address.
Create and modify zone files for a master bind dns server, updating example1.com, master.example2.com, and master.example3.com with administrator emails, verify files and group ownership, then restart 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.
Test name based virtual hosting using elinks, host, and ping to verify DNS resolution and Apache server behavior. See how resolv.conf and named.conf direct www.example1.com and www.example2.com to their zones.
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.
Set up the split namespace lab by removing existing addresses and adding 10.0.0.1/8 and 192.168.0.1/24 on the master router. Enable ip forwarding via /etc/sysctl.conf and sysctl -p, then verify three addresses.
Edit named.conf to implement split namespace views net-172, net-192, and external; define acls, match-clients, listen on 53, and assign zone files net-172.zone, net-192.zone, and other.zone for example.com.
Create and edit zone files in /var/named by copying forward to net-172.zone, net-192.zone, and other.zone; set named group; add master IN A records; configure SOA/NS; remove MX; restart name server.
copy the forward zone to net-172.zone, net-192.zone, and other.zone in /var/named, edit records (remove MX), set A entries to 172.24.0.1, 192.168.0.1, 10.0.0.1, and restart named with no errors.
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 the c21 client's hostname, domain, and IP settings, then demonstrate the split namespace test with host, nslookup, elinks, ping, and dig against 172.24.0.1.
Verify split namespace on the c21 system by testing network settings with hostname, dnsdomainname, ip route, ip a s, host, nslookup, and dig.
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 a postfix mail server with dns integration and mx records, deploy dovecot and squirrelmail, and test mail access via a gui client using imap and smtp.
Install postfix, dovecot, and squirrel mail on the master DNS server, add vim and telnet via EPL release, then enable static IP for DNS postfix configuration.
configure dns server demo guides setting up mail server dns on the master system, creating forward and reverse zone files, and testing with mx lookups.
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.
Configure the dovecot server by editing its config files, enable imap and pop3, disable plain text auth, enable login, and start postfix and dovecot, then test with telnet.
Test smtp using telnet by connecting to localhost on port 25, issuing hello, mail from, recipient, and data commands, ending with a dot, then verify the postfix mail log.
Test pop using telnet to verify mail delivery by logging in as a vpn user, listing and retrieving messages, then confirming dns and postfix server functionality.
Explore testing mail flow in a DNS-backed setup by sending and receiving messages between a non-user and a VPN user in a sandbox, using a Java-based client.
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.