<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>rhel 8 dns Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/rhel-8-dns/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Tue, 28 May 2019 10:28:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How to Install and Configure DNS on RHEL 8 and CENTOS 8</title>
		<link>https://www.osradar.com/how-to-install-and-configure-dns-on-rhel-8-and-centos-8/</link>
					<comments>https://www.osradar.com/how-to-install-and-configure-dns-on-rhel-8-and-centos-8/#respond</comments>
		
		<dc:creator><![CDATA[Muhammad Nabeel]]></dc:creator>
		<pubDate>Tue, 28 May 2019 10:28:11 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[Centos dns]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[DNS server]]></category>
		<category><![CDATA[rhel 8 dns]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=12104</guid>

					<description><![CDATA[<p>DNS Stands for domain name system, it translates website URL into IP addresses. You can say it is the phonebook of the internet as it is hard to remember IP addresses of each host so DNS makes it easy to remember URL instead of IP address. In this tutorial you will learn that how to [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-and-configure-dns-on-rhel-8-and-centos-8/">How to Install and Configure DNS on RHEL 8 and CENTOS 8</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>DNS Stands for domain name system, it translates website URL into IP addresses. You can say it is the phonebook of the internet as it is hard to remember IP addresses of each host so DNS makes it easy to remember URL instead of IP address.</p>
<p>In this tutorial you will learn that how to install and configure your own DNS server on the RHEL 8 and CentOS 8 server.</p>
<p>My Server Details:</p>
<p><strong>Operating System:  RedHat Enterprise Linux 8</strong><br />
<strong>Hostname:               primary.osradar.localdomain</strong><br />
<strong>IP Address:             192.168.130.152</strong></p>
<h3><strong>STEP 1:</strong><br />
Install bind (DNS) packages on your server.</h3>
<pre>yum install bind bind-utils -y</pre>
<p><img loading="lazy" class="alignnone wp-image-12107" src="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-17-46-15-300x169.png" alt="" width="678" height="382" srcset="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-17-46-15-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-17-46-15-768x434.png 768w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-17-46-15-1024x578.png 1024w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-17-46-15-696x393.png 696w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-17-46-15-1068x603.png 1068w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-17-46-15-744x420.png 744w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-17-46-15.png 1360w" sizes="(max-width: 678px) 100vw, 678px" /></p>
<h3><strong>STEP 2:</strong><br />
Configure DNS Server</h3>
<p>Edit <strong>/etc/named.conf</strong> file using below command and make below changes.</p>
<pre>vi /etc/named.conf</pre>
<p><strong>i:</strong> Comment below lines so BIND DNS Server will listen to all IP addresses.</p>
<pre>#listen-on port 53 { 127.0.0.1; };
#listen-on-v6 port 53 { ::1; };</pre>
<p><strong>ii:</strong> Add your network in below line, It will allow clients to query the DNS for the name (URL) to IP translation. My network is 192.168.130.0/24</p>
<pre>allow-query { localhost; 192.168.130.0/24; };</pre>
<p><img loading="lazy" class="alignnone wp-image-12108" style="font-family: Consolas, Monaco, monospace;" src="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-10-39-300x169.jpg" alt="" width="673" height="379" srcset="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-10-39-300x169.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-10-39-768x434.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-10-39-1024x578.jpg 1024w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-10-39-696x393.jpg 696w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-10-39-1068x603.jpg 1068w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-10-39-744x420.jpg 744w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-10-39.jpg 1360w" sizes="(max-width: 673px) 100vw, 673px" /></p>
<p><strong>iii: </strong>Create Forward and Reverse Zones</p>
<pre>zone "osradar.localdomain" IN {
type master;
file "forward.osradar";
allow-update { none; };
};
zone "130.168.192.in-addr.arpa" IN {
type master;
file "reverse.osradar";
allow-update { none; };
};
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
#listen-on port 53 { 127.0.0.1; };
#listen-on-v6 port 53 { ::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";
secroots-file "/var/named/data/named.secroots";
recursing-file "/var/named/data/named.recursing";
allow-query { localhost; 192.168.130.0/24; };

/*
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable
recursion.
- If your recursive DNS server has a public IP address, you MUST enable access
control to limit queries to your legitimate users. Failing to do so will
cause your server to become part of large scale DNS amplification
attacks. Implementing BCP38 within your network would greatly
reduce such attack surface
*/
recursion yes;

dnssec-enable yes;
dnssec-validation yes;

managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";

/* https://fedoraproject.org/wiki/Changes/CryptoPolicy */
include "/etc/crypto-policies/back-ends/bind.config";
};

logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};

zone "." IN {
type hint;
file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

zone "osradar.localdomain" IN {
type master;
file "forward.osradar";
allow-update { none; };
};
zone "130.168.192.in-addr.arpa" IN {
type master;
file "reverse.osradar";
allow-update { none; };
};

</pre>
<p><img loading="lazy" class="alignnone wp-image-12109" src="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-15-18-300x169.jpg" alt="" width="675" height="380" srcset="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-15-18-300x169.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-15-18-768x434.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-15-18-1024x578.jpg 1024w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-15-18-696x393.jpg 696w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-15-18-1068x603.jpg 1068w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-15-18-744x420.jpg 744w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-18-15-18.jpg 1360w" sizes="(max-width: 675px) 100vw, 675px" /></p>
<h3><strong>STEP 3:</strong><br />
Create DNS Zone files</h3>
<p>Create forward and reverse zone files which was added in the /etc/named.conf file.</p>
<p><strong>i:</strong> Create Forward Zone</p>
<p>Create <strong>forward.osradar</strong> file in the <strong>/var/named</strong> directory.</p>
<pre>vi /var/named/forward.osradar</pre>
<p>Add the following lines:</p>
<pre>$TTL 86400
@ IN SOA primary.osradar.localdomain. root.osradar.localdomain. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS primary.osradar.localdomain.
@ IN A 192.168.130.152

primary IN A 192.168.130.152</pre>
<p><img loading="lazy" class="alignnone wp-image-12110" src="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-08-30-300x225.png" alt="" width="673" height="505" srcset="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-08-30-300x225.png 300w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-08-30-768x576.png 768w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-08-30-80x60.png 80w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-08-30-265x198.png 265w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-08-30-696x522.png 696w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-08-30-560x420.png 560w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-08-30.png 800w" sizes="(max-width: 673px) 100vw, 673px" /></p>
<p><strong>ii:</strong> Create Reverse Zone</p>
<p>Create <strong>reverse.osradar</strong> file in the <strong>/var/named</strong> directory.</p>
<pre>vi /var/named/reverse.osradar</pre>
<p>Add the following lines:</p>
<pre>$TTL 86400
@ IN SOA primary.osradar.localdomain. root.osradar.localdomain. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS primary.osradar.localdomain.
@ IN PTR osradar.localdomain.
primary IN A 192.168.130.152

152 IN PTR primary.osradar.localdomain.</pre>
<p><img loading="lazy" class="alignnone wp-image-12111" src="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-09-08-300x225.png" alt="" width="672" height="504" srcset="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-09-08-300x225.png 300w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-09-08-768x576.png 768w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-09-08-80x60.png 80w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-09-08-265x198.png 265w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-09-08-696x522.png 696w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-09-08-560x420.png 560w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-09-08.png 800w" sizes="(max-width: 672px) 100vw, 672px" /></p>
<h3><strong>STEP 4:</strong><br />
Start the DNS service</h3>
<pre>systemctl start named
systemctl enable named</pre>
<p><img loading="lazy" class="alignnone wp-image-12112" src="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-10-10-300x106.png" alt="" width="674" height="238" srcset="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-10-10-300x106.png 300w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-10-10-768x271.png 768w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-10-10-696x245.png 696w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-10-10.png 800w" sizes="(max-width: 674px) 100vw, 674px" /></p>
<h3><strong>STEP 5:</strong><br />
Configure Firewall</h3>
<p>We must allow the DNS service or its port 53 in firewall.</p>
<pre>firewall-cmd --permanent --add-port=53/tcp
firewall-cmd --permanent --add-port=53/udp
firewall-cmd --reload</pre>
<p><img loading="lazy" class="alignnone wp-image-12113" src="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-11-24-300x120.png" alt="" width="678" height="271" srcset="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-11-24-300x120.png 300w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-11-24-768x308.png 768w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-11-24-696x279.png 696w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-20-11-24.png 800w" sizes="(max-width: 678px) 100vw, 678px" /></p>
<h3><strong>STEP 6:</strong><br />
Adding DNS Server in Network</h3>
<p>Add the DNS Server IP in network interface file.</p>
<pre>vi /etc/sysconfig/network-scripts/ifcfg-ens32</pre>
<p><strong>Note:</strong> ifcfg-xxxx will be your network interface file</p>
<p>I will add below entry as it is my DNS server IP address<br />
DNS=&#8221;192.168.130.152&#8243;</p>
<p><img loading="lazy" class="alignnone wp-image-12114" src="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-03-300x169.jpg" alt="" width="673" height="379" srcset="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-03-300x169.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-03-768x434.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-03-1024x578.jpg 1024w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-03-696x393.jpg 696w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-03-1068x603.jpg 1068w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-03-744x420.jpg 744w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-03.jpg 1360w" sizes="(max-width: 673px) 100vw, 673px" /></p>
<p>Add DNS server IP in /etc/resolv.conf</p>
<pre>vi /etc/resolv.conf</pre>
<p>nameserver 192.168.130.152</p>
<p><img loading="lazy" class="alignnone wp-image-12115" src="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-31-300x56.png" alt="" width="675" height="126" srcset="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-31-300x56.png 300w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-31-768x144.png 768w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-31-1024x192.png 1024w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-31-696x131.png 696w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-31-1068x200.png 1068w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-26-31.png 1360w" sizes="(max-width: 675px) 100vw, 675px" /></p>
<p>Now restart Network</p>
<pre>systemctl restart NetworkManager.service</pre>
<p>OR</p>
<pre>systemctl restart network</pre>
<h3><strong>STEP 7:</strong><br />
Test DNS Server</h3>
<pre>dig primary.osradar.localdomain</pre>
<p>Output</p>
<pre>; &lt;&lt;&gt;&gt; DiG 9.11.4-P2-RedHat-9.11.4-17.P2.el8_0 &lt;&lt;&gt;&gt; primary.osradar.localdomain
;; global options: +cmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 13585
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: df1e10c2a695c022e38035245cdafa6916303f22e15d5315 (good)
;; QUESTION SECTION:
;primary.osradar.localdomain. IN A

;; ANSWER SECTION:
primary.osradar.localdomain. 86400 IN A 192.168.130.152

;; AUTHORITY SECTION:
osradar.localdomain. 86400 IN NS primary.osradar.localdomain.

;; Query time: 2 msec
;; SERVER: 192.168.130.152#53(192.168.130.152)
;; WHEN: Tue May 14 22:27:05 PKT 2019
;; MSG SIZE rcvd: 114</pre>
<p><img loading="lazy" class="alignnone wp-image-12116" src="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-27-45-300x169.png" alt="" width="659" height="371" srcset="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-27-45-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-27-45-768x434.png 768w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-27-45-1024x578.png 1024w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-27-45-696x393.png 696w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-27-45-1068x603.png 1068w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-27-45-744x420.png 744w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-27-45.png 1360w" sizes="(max-width: 659px) 100vw, 659px" /></p>
<pre>nslookup osradar.localdomain</pre>
<p>Output</p>
<pre>Server: 192.168.130.152
Address: 192.168.130.152#53

Name: osradar.localdomain
Address: 192.168.130.152</pre>
<p><img loading="lazy" class="alignnone wp-image-12117" src="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-31-46-300x169.png" alt="" width="667" height="376" srcset="https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-31-46-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-31-46-768x434.png 768w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-31-46-1024x578.png 1024w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-31-46-696x393.png 696w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-31-46-1068x603.png 1068w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-31-46-744x420.png 744w, https://www.osradar.com/wp-content/uploads/2019/05/RHEL-8-VM-2019-05-14-22-31-46.png 1360w" sizes="(max-width: 667px) 100vw, 667px" /></p>
<h3>Client Machine Configuration</h3>
<p>Add the DNS server details in /etc/resolv.conf file of all desired client machines.</p>
<p>Run below command</p>
<pre>vi /etc/resolv.conf</pre>
<p>Then add below entry in that file where 192.168.130.152 will be replaced with your DNS server IP address.</p>
<pre>nameserver 192.168.130.152</pre>
<p>Now restart Your Network using one of following commands</p>
<pre>systemctl restart NetworkManager.service</pre>
<p>OR</p>
<pre>systemctl restart network</pre>
<p>&nbsp;</p>
<p>Test DNS Server from Client machine</p>
<pre>dig primary.osradar.localdomain</pre>
<pre>nslookup osradar.localdomain</pre>
<p>&nbsp;</p>
<p>That’s it. You have successfully installed BIND DNS on RHEL 8 / CENTOS 8 as master (Primary) server and now it is ready to use.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-and-configure-dns-on-rhel-8-and-centos-8/">How to Install and Configure DNS on RHEL 8 and CENTOS 8</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-install-and-configure-dns-on-rhel-8-and-centos-8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
