May 14, 2012. How to Configure Primary DNS Server in redhat 6 Step by Step. The Domain Name System (DNS) is the crucial glue that keeps computer networks in harmony by converting human-friendly hostnames to the numerical IP addresses computers require to communicate with each. To edit configuration file. Jul 17, 2014. Installing Samba 1. Use yum to install the Samba package: yum -y install samba Creating Samba Test Directory and Files For this part of the procedure, you'll use the su - (switch user) command to work as root. Although it's not best prac.
This tutorial explains how to configure DNS server in RedHat Linux step by step with practical example. Learn how to configure DNS Server (Master, Slave, Caching-only and Forwarding-only), DNS Zone (Forward and Reverse), DNS lookup, Chroot DNS environment and DNS clients in detail.
A DNS server, or name server, is used to resolve an IP address to a hostname or vice versa.
You can set up four different types of DNS servers:
Before configuring BIND to create a DNS server, you must understand some basic DNS concepts.
The entire hostname with its domain such as server.example.com is called a fully qualified domain name (FQDN). The right-most part of the FQDN such as .com or .net is called the top level domain, with the remaining parts of the FQDN, which are separated by periods, being sub-domains.
These sub-domains are used to divide FQDNs into zones, with the DNS information for each zone being maintained by at least one authoritative name server.
The authoritative server that contains the master zone file, which can be modified to update DNS information about the zone, is called the primary master server, or just master server.
The additional name servers for the zone are called secondary servers or slave servers. Secondary servers retrieve information about the zone through a zone transfer from the master server or from another secondary server. DNS information about a zone is never modified directly on the secondary server
chroot feature is run named as user named, and it also limit the files named can see. When installed, named is fooled into thinking that the directory /var/named/chroot is actually the root or / directory. Therefore, named files normally found in the /etc directory are found in /var/named/chroot/etc directory instead, and those you would expect to find in /var/named are actually located in /var/named/chroot/var/named.
The advantage of the chroot feature is that if a hacker enters your system via a BIND exploit, the hacker's access to the rest of your system is isolated to the files under the chroot directory and nothing else. This type of security is also known as a chroot jail.
In this example we will configure a dns server and will test from client side.
For this example we are using three systems one linux server one linux clients and one window clients.
bind and caching-nameserver rpm is required to configure dns. check them for install if not found install them.
set hostname to server.example.com and ip address to 192.168.0.254
main configuration file for dns server is named.conf. By default this file is not created in /var/named/chroot/etc/ directory. Instead of named.conf a sample file /var/named/chroot/etc/named.caching-nameserver.conf is created. This file is use to make a caching only name server. You can also do editing in this file after changing its name to named.conf to configure master dns server or you can manually create a new named.conf file.
In our example we are creating a new named.conf file
We are using bind's chroot features so all our necessary files will be located in chroot directory. Set directory location to /var/named. Further we will set the location of forward zone and reverse lookup zone files.
Do editing exactly as shown here in image
save this file with :wq and exit
We have defined two zone files example.com.zone for forward zone and 0.168.192.in-addr.arpa for reverse zone. These files will be store in /var/named/chroot/var/named/ location. We will use two sample files for creating these files.
Change directory to /var/named/chroot/var/named and copy the sample files to name which we have set in named.conf
Now open forward zone file example.com.zone
By default this file will look like this
Change this file exactly as shown in image below
Now open reverse lookup zone file 0.168.192.in-addr.arpa
By default this file will look like this
Change this file exactly as shown in image below
Now changed the ownership of these zone files to named group
Now start the named service
If service restart without any error means you have successfully configured master name server.
For this example we are using three systems one linux server one linux clients and one window clients.
We have configured master DNS server with ip address of 192.168.0.254 and hostname server.example.com on linux server. Now we will configure slave DNS server on linux clients
To configure slave DNS server go on client1 system.
First test connectivity from dns server by ping commands and check necessary rpm. bind and caching-nameserver rpm is required to configure dns. check them for install if not found install them.
set hostname to client1 and ip address to 192.168.0.1 And create a new named.conf file
We are using bind's chroot features so all our necessary files will be located in chroot directory. Set directory location to /var/named. As we are configuring slave server so we need not to define the location of zone database files. Zone database file can be created and modified only on master server. A slave server only copied it's from master server.
Do editing exactly as shown here in image in named.conf
save this file with :wq and exit
Now restart the named service. It should be start without any error.
Congratulation you have configured both Master and client DNS server. Now we will configure dns client and test it with dns server.
Now go on windows xp system and test connectivity from DNS server. And set DNS ip address in LAN card properties.
Now go on commands prompt and ping from other client by name to test dns.
Alternately You can also verify DNS server by nslookup command
Test also by pinging server from name
RHCE Exam question Dig Server.example.com, Resolve to successfully through DNS Where DNS server is 192.168.0.254.
RHCE Exam question2
Your System is configured in 192.168.0.0/24 Network and your nameserver is 192.168.0.254. Make successfully resolve to server.example.com.
On command line interface you don't have any options to set DNS ip in network configuration window. IP of DNS server can be set from /etc/resolv.conf file. Each nameserver line represents a DNS server, and the search line specifies domain names to try if only the first part of a hostname is used. For example, if just the name client1 is used as a hostname, client1. example.com will also be tried if the /etc/resolv.conf file is configured as shown in image below on the system.
To set DNS ip open /etc/resolv.conf file
set nameserver ip to 192.168.0.254 and search option to example.com
After saving /etc/resolv.conf file restart the network service
dig server.example.com to test dns server
now verify by pinging to other client from name