Can't get DNS to resolve host names

Issues related to configuring your network
Post Reply
Whitehorse1
Posts: 1
Joined: 2017/04/23 16:58:04

Can't get DNS to resolve host names

Post by Whitehorse1 » 2017/04/23 17:24:11

Im trying to set up a smaller network for school and i need to make it able to use its own DNS server.
Trouble is when i set the DNS server's resolv.conf file to look for localhost (it has to use localhost due to the task requirements) it stops being able to ping hostnames while still being able to ping IP addresses.
I have tried countless other threads and topics to try and fix this and everything i could find either didn't work or was completely irelevant.

resolv.conf:

Code: Select all

search linuxmda.dk
nameserver 127.0.0.1
linuxmda.dk.db

Code: Select all

$TTL    1D
@       IN      SOA     ns.linuxmda.dk. root.linuxmda.dk.       (
                        04;serial
                        28800;refresh
                        900;retry
                        1209600;expire
                        43200;default_ttl
                        )
             IN      NS      ns.
             IN      MX      10      mail.linuxmda.dk.
mail      IN      A       10.170.10.10
dns       IN      A       10.170.10.40
web      IN      A       10.170.10.30
www     IN      A       10.170.10.30
dg        IN      A       10.170.10.1
10.170.10.db:

Code: Select all

$TTL    1D
@	IN	SOA     ns.linuxmda.dk. root.linuxmda.dk.	(
                        04;serial
                        28800;refresh
                        900;retry
                        1209600;expire
                        43200;default_ttl
                        )
        IN	NS	ns.
10	IN	PTR     mail.linuxmda.dk.
40	IN	PTR     dns.linuxmda.dk.
30	IN	PTR     web.linuxmda.dk.
30	IN	PTR     www.linuxmda.dk.
1	IN	PTR     dg.linuxmda.dk.
named.conf:

Code: Select all

options {
	listen-on port 53 { 127.0.0.1;10.170.10.40;};
        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;10.170.10.0/24; };
        recursion yes;
        
#	dnssec-enable yes;
        dnssec-validation no;

        forwarders {127.0.0.1;10.170.10.40; };
        forward only;
        /* Path to ISC DLV key */
#	bindkeys-file "/etc/named.iscdlv.key";

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

};

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

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

zone    "linuxmda.dk"   IN	{
        type    master;
        file    "linuxmda.dk.db";
        allow-update    {none;};
};

zone    "10.170.10.in-addr.arpa"        IN	{
        type    master;
        file    "10.170.10.db";
        allow-update    {none;};
};

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

markkuk
Posts: 739
Joined: 2007/09/07 10:56:28
Location: Finland

Re: Can't get DNS to resolve host names

Post by markkuk » 2017/04/24 14:17:28

Your named.conf has the "forward only" option, and the "forwarders" option appears to point back to the same machine. This would mean all queries are forwarded to an infinite loop, and no name resolution gets done. Try removing or commenting out the forwarding options. If that works, point the "forwarders" to your ISP's DNS servers (or some other outside DNS servers, e.g. Google or OpenDNS) and change the other option to "forward first".

Post Reply

Return to “CentOS 6 - Networking Support”