0

I need install the DNS Server (BIND - CentOS 7) to work only locally. I mean, the same CentOS that has the BIND will connect/search in the DNS, any other host will 'connect' with this machine.

The objective is use the command host (e.g. host hostname) to get the IP address. Configuring the /etc/hosts will not work for me because the product that I'm going to use, run the 'host' to validate some pre-requesits of the system.

On that validation, I'm getting the error FQDN is not valid. Because this, the server must be using a DNS to validate de hostname. - The hostname was configured on /etc/hostname file - How this is only for tests, I'm building a VM using the CentOS 7 and I don't have another DNS Server.

I've already installed the bind and started the services and tested, but I'm still getting the error: Host demo.localdomain not found: 3(NXDOMAIN)

Follow my /etc/hosts, /etc/nsswitch.conf, /etc/sysconfig/network and /etc/hostname files:

/etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1   demo.localdomain demo

/etc/nsswitch.conf

cat /etc/nsswitch.conf | grep hosts
#hosts:     db files nisplus nis dns
#hosts:      files dns myhostname
hosts:      files [NOTFOUND=return] dns

/etc/hostname

demo.localdomain

/etc/sysconfig/network

HOSTNAME=demo.localdomain

Here, the named.conf file of BIND

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";
    allow-query     { localhost; };
    recursion no;

    dnssec-enable yes;
    dnssec-validation yes;
    dnssec-lookaside auto;

    /* Path to ISC DLV key */
    bindkeys-file "/etc/named.iscdlv.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";
};

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

/etc/resolv.conf

# Generated by NetworkManager
search localdomain
nameserver 201.17.128.111 #DNS to connect into internet
nameserver 201.171.28.105 #DNS to connect into internet

How can I solve this?

Thanks in advance.

  • Can you at least post the "host" syntax you are using? – Jesse K Aug 21 '15 at 20:48
  • I Jesse, thanks for reply. I've managed to fix the problem with the product that I was installing. Putting the .com in the end of the hostname solved the problem. Thanks – mayconbelfort Aug 26 '15 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.