Score:0

Named server cannot be started

uy flag

Good day, I am trying to follow this DNS server setup tutorial

Here's what I was hoping to setup

win10 | 192.168.1.247

ns1 | 192.168.1.203

mint | 192.168.1.183

domain: nyc3.example.com

my named-checkconf returns correctly, but when I try to run $systemctl start named, I cannot start it.

$systemctl status named.service - l

named.service - Berkeley Internet Name Domain (DNS)
   Loaded: loaded (/usr/lib/systemd/system/named.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2023-08-13 00:12:39 EDT; 17s ago
  Process: 76083 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi (code=exited, status=1/FAILURE)

Aug 13 00:12:39 dnsCentOS bash[76083]: _default/0.in-addr.arpa/IN: file not found
Aug 13 00:12:39 dnsCentOS bash[76083]: zone nyc3.example.com/IN: loading from master file etc/named/zones/db.nyc3.example.com failed: file not found
Aug 13 00:12:39 dnsCentOS bash[76083]: zone nyc3.example.com/IN: not loaded due to errors.
Aug 13 00:12:39 dnsCentOS bash[76083]: _default/nyc3.example.com/IN: file not found
Aug 13 00:12:39 dnsCentOS bash[76083]: /etc/named/zones/db.192:1: no TTL specified; using SOA MINTTL instead
Aug 13 00:12:39 dnsCentOS bash[76083]: zone 192.in-addr.arpa/IN: loaded serial 3
Aug 13 00:12:39 dnsCentOS systemd[1]: named.service: control process exited, code=exited status=1
Aug 13 00:12:39 dnsCentOS systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Aug 13 00:12:39 dnsCentOS systemd[1]: Unit named.service entered failed state.
Aug 13 00:12:39 dnsCentOS systemd[1]: named.service failed.

Here's my /etc/named.conf. I tried changing to a different directory, it seemed to not work

//
// 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.201; };
#   listen-on-v6 port 53 { ::1; };
    #directory  "/var/named";
    directory   "/etc/named/zones";
    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     { trusted; };

    /* 
     - 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;
        };
};

acl "trusted" {
    192.168.1.201;  #ns1  ---primary DNS server
    192.168.1.247;  #win10
    192.168.1.183;  #mint
};

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

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
include "/etc/named.conf.local";

Here's my /etc/named/named.conf.local

zone "nyc3.example.com" {
    type master;
    file "/etc/named/zones/db.nyc3.example.com";
};

zone "192.in-addr.arpa" {
    type master;
    file "/etc/named/zones/db.192";
};

Here's my /etc/named/zones/db.nyc3.example.com

@   IN  SOA ns1.nyc3.example.com.   admin.nyc3.example.com. (
                3       ; Serial
                604800      ; Refresh
                86400       ; Retry
                2419200     ; Expire
                604800 )    ; Negative Cache TTL

; name servers - NS records
    IN  NS  ns1.nyc3.example.com.

; name servers - A records
ns1.nyc3.example.com.       IN  A   192.168.1.201

; 192.168.1.0/8 -A records
win10.nyc3.example.com.     IN  A   192.168.1.247
mint.nyc3.example.com.      IN  A   192.168.1.183

Here's my /etc/named/zones/db.192

`@  IN  SOA ns1.nyc3.example.com.   admin.nyc3.example.com. (
                3       ; Serial
                604800      ; Refresh
                86400       ; Retry
                2419200     ; Expire
                604800 )    ; Negative Cache TTL

; name servers - NS records
    IN  NS  ns1.nyc3.example.com.

; PTR records
201.1   IN  PTR ns1.nyc3.example.com.   ; 192.168.1.201
247.1   IN  PTR win10.nyc3.example.com. ; 192.168.1.247
183.1   IN  PTR mint.nyc3.example.com.  ; 192.168.1.183

thank you

vidarlo avatar
ar flag
Fix the errors that the log messages tells you about. If it still doesn't start, come back.
Score:2
cn flag

I guess there is a typo for master file path in a config file.

A slash is missing at the beginning of the path

zone nyc3.example.com/IN: loading from master file etc/named/zones/db.nyc3.example.com failed: file not found

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.