<?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>Configure DNS Server on CentOS 8 Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/configure-dns-server-on-centos-8/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Fri, 20 Dec 2019 12:35:27 +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 Configure Master / Slave BIND DNS Server on CentOS 8 / RHEL 8</title>
		<link>https://www.osradar.com/how-to-configure-master-slave-bind-dns-server-on-centos-8-rhel-8/</link>
					<comments>https://www.osradar.com/how-to-configure-master-slave-bind-dns-server-on-centos-8-rhel-8/#respond</comments>
		
		<dc:creator><![CDATA[sabi]]></dc:creator>
		<pubDate>Fri, 20 Dec 2019 12:35:25 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[BIND DNS server configuration]]></category>
		<category><![CDATA[Configure DNS Server on CentOS 8]]></category>
		<category><![CDATA[Master / Slave DNS server]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=16620</guid>

					<description><![CDATA[<p>Today we are going to cover the installation &#38; configuration of BIND DNS Server on CentOS / RHEL 8. DNS as you all know is used to name the all computers connected to the Internet. It assigns the address to every computer with a FQDN associated with it. It&#8217;s importance goes high due to the [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-configure-master-slave-bind-dns-server-on-centos-8-rhel-8/">How To Configure Master / Slave BIND DNS Server on CentOS 8 / RHEL 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>Today we are going to cover the installation &amp; configuration of BIND DNS Server on CentOS / RHEL 8. DNS as you all know is used to name the all computers connected to the Internet. It assigns the address to every computer with a FQDN associated with it. It&#8217;s importance goes high due to the part of Application layer of the TCP / IP reference model. So , in this tutorial we are going to install an Authoritative BIND DNS Master &amp; Slave on CentOS 8 and also we&#8217;ll cover its configuration like adding PTR, A /AAAA records among others.</p>



<h2><strong>Step 1: Installing Bind DNS Server on CentOS 8 / RHEL 8</strong></h2>



<p>You can install the bind DNS server on CentOS / RHEL 8 by running the below command</p>



<pre class="wp-block-verse">$ dnf -y install bind bind-utils vim<br>CentOS-8 - AppStream                                   1.3 kB/s | 4.3 kB     00:03    <br>CentOS-8 - Base                                        1.2 kB/s | 3.9 kB     00:03    <br>CentOS-8 - Extras                                      467  B/s | 1.5 kB     00:03    <br>Dependencies resolved</pre>



<p>Make sure to keep SELinux in Enforcing mode.</p>



<pre class="wp-block-verse">$ getenforce</pre>



<h3><strong>Step 2: Configure BIND DNS Authoritative Server on CentOS 8 / RHEL 8</strong></h3>



<p>Now you can configure the BIND DNS Authoritative server by opening the configuration file. You can find out the config file in the <strong>/etc/named.conf.</strong> </p>



<p>In my case I&#8217;ll add the following settings to my DNS, you can set up as you required.</p>



<ul><li><strong>osradar.com</strong> Zone (Domain Name)</li><li><strong>192.168.109.0</strong> Managed subnet</li><li><strong>192.168.109.75</strong> IP of slave server</li><li><strong>192.168.109.59</strong> IP of the master server</li></ul>



<p>Edit the <strong>/etc/named.conf</strong> file by running below command and apply the settings.</p>



<pre class="wp-block-verse">$ sudo vim /etc/named.conf<br> //<br> // named.conf<br> //<br> // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS<br> // server as a caching only nameserver (as a localhost DNS resolver only).<br> //<br> // See /usr/share/doc/bind*/sample/ for example named configuration files.<br> //<br> options {<br>          listen-on port 53 { any; }; ## Listen on any since it is an authoritative DNS Publicly available. <br>          listen-on-v6 port 53 { any; }; ## You can also set the same for IPv6<br>          directory       "/var/named";<br>          dump-file       "/var/named/data/cache_dump.db";<br>          statistics-file "/var/named/data/named_stats.txt";<br>          memstatistics-file "/var/named/data/named_mem_stats.txt";<br>          secroots-file   "/var/named/data/named.secroots";<br>          recursing-file  "/var/named/data/named.recursing";<br>  ## Since this will be an authoritative Nameserver, allow query from any host <br>         allow-query     { any; };          <br>         allow-transfer  {192.168.109.75; };     <br> /*<br> 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.<br> */     <br>    recursion no; ## Following Advice from above.     <br>    dnssec-enable yes;     <br>    dnssec-validation yes;     <br>    managed-keys-directory "/var/named/dynamic";     <br>    pid-file "/run/named/named.pid";     <br>    session-keyfile "/run/named/session.key";      <br> /* <a href="https://fedoraproject.org/wiki/Changes/CryptoPolicy">https://fedoraproject.org/wiki/Changes/CryptoPolicy</a> */     include "/etc/crypto-policies/back-ends/bind.config";<br> };<br> logging {<br>          channel default_debug {<br>                  file "data/named.run";<br>                  severity dynamic;<br>          };<br> };<br> zone "." IN {<br>          type hint;<br>          file "named.ca";<br> };<br> include "/etc/named.rfc1912.zones";<br> include "/etc/named.root.key";<br> Set your ZONE details as shown below for different domains. Set the forward and reverse details. You can set the names of files as you like<br> zone "<a href="https://osradar.com">osradar.com</a>" IN {<br>         type master;<br>         file "osradar.forward";<br>         allow-update { none; };<br> };<br> Make sure you follow the rule for reverse zone (109.168.192.in-addr.arpa). [If your IP is 192.168.10.10, It will be 10.168.192.in-addr.arpa]<br> zone "109.168.192.in-addr.arpa" IN {<br>         type master;<br>         file "osradar.reverse";<br>         allow-update { none; };<br> };</pre>



<p>Make sure that your IP is Public one as this is an Authoritative DNS Server.</p>



<h3><strong>Step 3: Creating Zone Files</strong></h3>



<p>After finishing configuring in named.conf you will have to create the Zone files &amp; place all the records that you would wish to add such as A/AAAA, MX,PTR &amp; others.<br>Create the zone files in the <strong>/var/named/</strong> directory.</p>



<pre class="wp-block-verse">$ sudo vim /var/named/osradar.com.forward<br><br><br> $TTL 86400<br>  @   IN  SOA     <a href="https://osradar.com">dns1.osradar.com.</a> <a href="https://osradar.com">root.osradar.com</a>. (<br>  # You can use any numerical values for serial number but it is recommended to use [YYYYMMDDnn]<br>          2019112201  ;Serial<br>          3600        ;Refresh<br>          1800        ;Retry<br>          604800      ;Expire<br>          86400       ;Minimum TTL<br> )<br>          # Set your Name Servers here<br>          IN  NS      <a href="https://osradar.com">dns1.osradar.com</a>.<br>          IN  NS      <a href="http://https;//osradar.com">dns2.osradar.com</a>.<br>          # define Name Server's IP address<br>          IN  A       192.168.109.59<br>          # Set your Mail Exchanger (MX) Server here<br>          IN  MX 10   <a href="https://osradar.com">dns1.osradar.com</a>.<br> Set each IP address of a hostname. Sample A records.<br> dns1     IN  A       192.168.109.59<br> dns2     IN  A       192.168.109.75<br> mail1    IN  A       192.168.109.78</pre>



<p>Now create the corresponding reverse records for the same domain we had defined in the named.conf file.</p>



<pre class="wp-block-verse">$ sudo vim /var/named/osradar.reverse<br><br><br> $TTL 86400<br>  @   IN  SOA     <a href="https://osradar.com">dns1.osradar.com</a>. <a href="https://osradar.com">root.osradar.com</a>. (<br>          2019112201  ;Serial<br>          3600        ;Refresh<br>          1800        ;Retry<br>          604800      ;Expire<br>          86400       ;Minimum TTL<br>  )<br>          # Set Name Server<br>          IN  NS      <a href="https://osradar.com">dns1.osradar.com</a>.<br> Set each IP address of a hostname. Sample PTR records.<br> 88      IN  PTR     <a href="https://osradar.com">dns1.osradar.com</a>.<br> 94      IN  PTR     <a href="https://osradar.com">dns2.osradar.com</a>.<br> 97      IN  PTR     <a href="https://osradar.com">mail1.osradar.com</a>.</pre>



<h3><strong>Step 4: Alter DNS Settings on Master Server</strong></h3>



<p>Now make our new DNS Server as the default Name Server. Edit the file <strong>/etc/resolv.conf</strong> &amp; add the below lines into it.</p>



<pre class="wp-block-verse">$ sudo vim /etc/resolv.conf  <br> nameserver 192.168.109.59</pre>



<p><strong>Note</strong>: Replace the IP Address with your one.</p>



<h3><strong>Step 5: Firewall </strong></h3>



<p>Allow dns service on the firewall</p>



<p>Run the below lines to allow dns service on the firewall</p>



<pre class="wp-block-verse">sudo firewall-cmd --add-service=dns --permanent<br>sudo firewall-cmd --reload</pre>



<p>Make sure you&#8217;ve done the correct configuration. Double check the configuration by typing</p>



<pre class="wp-block-verse">sudo named-checkconf</pre>



<p>Start and Enable bind services</p>



<pre class="wp-block-verse">sudo systemctl start named<br>sudo systemctl enable named</pre>



<p>So far, we&#8217;ve configured our Master BIND DNS server. Let&#8217;s move toward our Slave server.</p>



<h3><strong>Step 6: Configuring Slave DNS Server </strong></h3>



<p>Run the below command on Slave server to install bind &amp; bind utils.</p>



<pre class="wp-block-verse">sudo dnf -y install bind bind-utils vim</pre>



<p>Now edit the file <strong>/etc/named.conf</strong> and edit it accordingly to configure the slave server.</p>



<pre class="wp-block-verse">$ sudo vim /etc/named.conf<br> //<br> // named.conf<br> // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS<br> // server as a caching only nameserver (as a localhost DNS resolver only).<br> // See /usr/share/doc/bind*/sample/ for example named configuration files.<br> // See the BIND Administrator's Reference Manual (ARM) for details about the<br> // configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html<br> options {<br>          listen-on port 53 { any; };<br>          listen-on-v6 port 53 { any; };<br>          directory       "/var/named";<br>          dump-file       "/var/named/data/cache_dump.db";<br>          statistics-file "/var/named/data/named_stats.txt";<br>          memstatistics-file "/var/named/data/named_mem_stats.txt";<br>          recursing-file  "/var/named/data/named.recursing";<br>          secroots-file   "/var/named/data/named.secroots";<br>          allow-query     { any; }; ## Allows hosts to query Slave DNS<br>          allow-transfer { none; }; ## Disable zone transfer<br> <code>      /*        - 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       */</code><br> Since this is a slave, lets allow recursion.<br> <code>recursion yes;      dnssec-enable yes;      dnssec-validation yes;</code><br> /* Path to ISC DLV key */<br>      bindkeys-file "/etc/named.root.key";<br>     managed-keys-directory "/var/named/dynamic";     <br>     pid-file "/run/named/named.pid";     <br>     session-keyfile "/run/named/session.key";<br> };<br> logging {<br>          channel default_debug {<br>                  file "data/named.run";<br>                  severity dynamic;<br>          };<br> };<br> zone "." IN {<br>          type hint;<br>          file "named.ca";<br> };<br> include "/etc/named.rfc1912.zones";<br> include "/etc/named.root.key";<br> Let us create zone definitions for both forward and reverse dns lookups.<br> The files will be created automatically on the slave.<br> zone "<a href="https://osradar.com">osradar.com</a>" IN {<br>          type slave;<br>          file "slaves/osradar.forward";<br>          masters { 192.168.109.59; }; ## Master server it is receiving DNS Records from<br> };<br> zone  "109.168.192.in-addr.arpa" IN {<br>          type slave;<br>          file "slaves/osradar.reverse";<br>          masters { 192.168.109.59; }; ## Master server it is receiving DNS Records from<br> };</pre>



<h3><strong>Step 7: Alter DNS Settings on Slave Server</strong></h3>



<p>Open the file <strong>/etc/resolv.conf </strong>&amp; add the IP of slave </p>



<pre class="wp-block-verse">$ sudo vim /etc/resolv.conf<br>
nameserver 192.168.109.59<br>
nameserver 192.168.109.75</pre>



<p>Now double check the configurations &amp; start and enable bind services</p>



<pre class="wp-block-verse">sudo named-checkconf<br>sudo systemctl start named<br>sudo systemctl enable named</pre>



<p>Check that zone files have transferred from the master.</p>



<pre class="wp-block-verse">$ ll /var/named/slaves/<br>
total 12<br>
-rw-r--r-- 1 named named 480 Dec 14 14:16 osradar.forward<br>
-rw-r--r-- 1 named named 492 Dec 14 14:45 osradar.reverse</pre>



<p>Congratulations! You have successfully Configured Master / Slave Server on CentOS 8.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-configure-master-slave-bind-dns-server-on-centos-8-rhel-8/">How To Configure Master / Slave BIND DNS Server on CentOS 8 / RHEL 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-configure-master-slave-bind-dns-server-on-centos-8-rhel-8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
