SOLVED: DNS configuration with book "Learn CentOS Linux Network Services

Issues related to configuring your network
Post Reply
arek199602
Posts: 5
Joined: 2019/10/18 14:05:51

SOLVED: DNS configuration with book "Learn CentOS Linux Network Services

Post by arek199602 » 2019/10/18 14:23:14

Hello. Sorry for my english. I've got a problem with dns configuration.
My named.conf file:

Code: Select all

//
// 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.
//
// See the BIND Administrator's Reference Manual (ARM) for details about the
// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html

options {
	listen-on port 53 { 127.0.0.1; 192.168.1.20; };
	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";
	recursing-file  "/var/named/data/named.recursing";
	secroots-file   "/var/named/data/named.secroots";
	allow-query     { localhost; 192.168.1.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;

	/* Path to ISC DLV key */
	bindkeys-file "/etc/named.root.key";

	managed-keys-directory "/var/named/dynamic";

	pid-file "/run/named/named.pid";
	session-keyfile "/run/named/session.key";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
	type hint;
	file "named.ca";
};

zone "olimpus.local" IN {
	type master;
	file "olimpus.local.zone";
	//allow-update { none; };
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
My olimpus.local.zone file:

Code: Select all

;
;Data file for olimpus.local
;
$TTL 2D
olimpus.local.   IN SOA olimpus.local. root.olimpus.local. (
                 2014082701;       Serial
                 1D;             Refresh
                 2H;             Retry
                 1W;             Expire
                 2D);            Default TTL
   
           IN NS delphos.olimpus.local.
           IN MX 10 prometheus.olimpus.local.

delphos         IN A    192.168.1.20
prometheus      IN A    192.168.1.21
aphrodite       IN A    192.168.1.22
dns             IN CNAME        delphos
mail            IN CNAME        prometheus
My ifcfg-ens33 file:

Code: Select all

PROXY_METHOD=none
BROWSER_ONLY=no
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=1f37913b-67e7-438c-8d76-ac4032988ab0
DEVICE=ens33
ONBOOT=no
BOOTPROTO=dhcp
TYPE=Ethernet
DNS="192.168.1.20"
My resolv.conf file

Code: Select all

# Generated by NetworkManager
search localdomain
nameserver 192.168.64.2
nameserver 192.168.1.20
When I execute command dig @192.168.1.20 delphos.olimpus.local I get:

Code: Select all

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-9.P2.el7 <<>> @192.168.1.21 delphos.olimpus.local
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

and when I execute dig olimpus.local I get

Code: Select all

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-9.P2.el7 <<>> olimpus.local
;; global options: +cmd
;; Got answer:
;; WARNING: .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 11839
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; MBZ: 0x0005, udp: 65494
;; QUESTION SECTION:
;olimpus.local.			IN	A

;; Query time: 0 msec
;; SERVER: 192.168.64.2#53(192.168.64.2)
;; WHEN: Fri Oct 18 10:21:02 EDT 2019
;; MSG SIZE  rcvd: 42

Last edited by arek199602 on 2019/10/28 21:18:10, edited 1 time in total.

User avatar
jlehtone
Posts: 2381
Joined: 2007/12/11 08:17:33
Location: Finland

Re: DNS configuration with book "Learn CentOS Linux Network Services

Post by jlehtone » 2019/10/18 16:01:20

What is the actual goal?
To learn about the "ISC BIND named(8) DNS server"?
To set up a DNS server?

For the latter (and for simple domain) the dnsmasq is much simpler server to get up and running.

arek199602
Posts: 5
Joined: 2019/10/18 14:05:51

Re: DNS configuration with book "Learn CentOS Linux Network Services

Post by arek199602 » 2019/10/18 17:17:44

I have to learn how to set up dns and I would like to understand it a bit, because I have task related to dns in college.
I've try another tutorials and them worked but I cannot understand why this configuration not work properly. These tutorials also did not completely explain how it works so I wrote here. I would like add that system is running on vmware workstation 15.5.

User avatar
TrevorH
Forum Moderator
Posts: 26934
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: DNS configuration with book "Learn CentOS Linux Network Services

Post by TrevorH » 2019/10/18 17:25:39

Check for bind related messages in /var/log/message.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

arek199602
Posts: 5
Joined: 2019/10/18 14:05:51

Re: DNS configuration with book "Learn CentOS Linux Network Services

Post by arek199602 » 2019/10/18 20:39:01

Ok I solved the problem. I think that possible cause was wrong configuration my network.
Topic to close.
Thank for your help.

Post Reply

Return to “CentOS 7 - Networking Support”