-   Linux - Networking (
-   -   DNS- No servers could be reached (

edgambite 11-04-2008 09:57 PM

DNS- No servers could be reached
Hi, I've tried to do extensive searching on the web, including this site but I haven't found anything quite related to what I am experiencing. Here is the situation:

What I have:
Windows XP on PC workstation
Windows XP on Laptop workstation
VM Centos 5.1 on Laptop (As my DNS server - ns1)
VM Centos 5.1 on Laptop

I have set up my zone files and am able to connect to internet, ping, and nslookup both local hosts as well as etc. I am only able to accomplish this on ns1. Once I try to configure /etc/resolv.conf on my centos host, I cannot reach ns1. I have set ns1 as my DNS server and cannot, therefore connect to the internet.

/var/log/messages tells me that my host is trying to find /etc/named.conf when booting named. From what I understand, my hosts should not need named.conf or any of the other zone files to query ns1. 1) Is this correct?

2) How do I configure my host to bypass searching for /etc/named.conf when booting named? Or is this even necessary?

Now I also have the same issue when trying to set up ns1 as the DNS server for either one of my Windows workstations. I cannot ping and nslookup gives me the error "cannot find server name for address...DNS request timed out."

I have disabled selinux on both centos machines and set my firewalls on my windows workstations to allow these ips. All machines can ping each other so I am pretty sure this issue is not a firewall issue.

What do you gurus suggest?

centos82 11-04-2008 10:23 PM

What does /etc/resolv.conf look like on ns1. What does it look like on the other CentOS VM? What does /etc/hosts look like on ns1? Where are you storing your zone files and how does named know where to find them? You should probably have an /etc/named.conf file that contains your zone and which file to use for hosts in that zone.

billymayday 11-04-2008 10:31 PM

If you are starting the named service, of course it needs its config file. named.conf is not a zone file - it's a config for named (aka bind). named.conf will then tell named what zone filed you have and where they are.

IF you used the default package for named on CentOS, it's probably the chrooted version, so in fact, named will be looking in /var/named/chroot/etc for named.conf.

edgambite 11-04-2008 10:43 PM

billy...the reason I know that it is looking for /etc/named.conf is through the syslog in /var/log/messages that tells me the error when I run named. I also get the same "connection timed out; no servers could be reached.

centos: this is resolv.conf on ns1:

[edgambite@ns1 ~]$ cat /etc/resolv.conf
; generated by /sbin/dhclient-script
[edgambite@ns1 ~]$


[root@ns1 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
::1 localhost.localdomain localhost ns1

/etc/resolv.conf on my centos host is:


My zone files are stored in the right place because ns1 functions properly in DNS nslookup, ping, internet, etc.

billymayday 11-04-2008 10:49 PM

Named thinks it looking in /etc if it's chrooted, but will actually be looking in /var/named/chroot/etc

Can you post

# cat /etc/sysconfig/named

edgambite 11-04-2008 11:00 PM

[root@ns1 ~]# cat /etc/sysconfig/named
# BIND named process options
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
# Currently, you can use the following options:
# ROOTDIR="/some/where" -- will run named in a chroot environment.
# you must set up the chroot environment
# (install the bind-chroot package) before
# doing this.
# OPTIONS="whatever" -- These additional options will be passed to named
# at startup. Don't add -t here, use ROOTDIR instead.
# ENABLE_ZONE_WRITE=yes -- If SELinux is disabled, then allow named to write
# its zone files and create files in its $ROOTDIR/var/named
# directory, necessary for DDNS and slave zone transfers.
# Slave zones should reside in the $ROOTDIR/var/named/slaves
# directory, in which case you would not need to enable zone
# writes. If SELinux is enabled, you must use only the
# 'named_write_master_zones' variable to enable zone writes.
# ENABLE_SDB=yes -- This enables use of 'named_sdb', which has support
# -- for the ldap, pgsql and dir zone database backends
# -- compiled in, to be used instead of named.
# DISABLE_NAMED_DBUS=[1y]-- If NetworkManager is enabled in any runlevel, then
# the initscript will by default enable named's D-BUS
# support with the named -D option. This setting disables
# this behavior.

This is on the host. Should I even need named.conf for a resolver?

centos82 11-04-2008 11:03 PM

A sample of what your named.conf file should look like is this:

options {
directory "/var/named";
heartbeat-interval 1440;

zone "" {
type master;
file "private.hosts";

Where you replace private.hosts with whatever file you are using for that zone. And it would have to be located in /var/named as bind sees it.

Billy is right about the chroot thing so probablu your named.conf file will be in /var/named/chroot/etc/named.conf and your private.hosts file will need to be in /var/named/chroot/var/named/private.hosts.

billymayday 11-04-2008 11:08 PM

So it's chrooted. You may want to create a link to /etc/named.conf in /var/named/chroot/etc/named.conf

Yes if you want named to run otherwise no. What exactly do you mean by a resolver?

Edit - took too long to post.

edgambite 11-04-2008 11:10 PM

This is my /etc/named.conf on ns1:

// Bind configuration file
options {
// Place additional options here.

zone "" in {
type master;
file "";

zone "" in {
type master;
file "db.192.168.2";

zone "" in {
type master;
file "db.127.0.0";

zone "." in {
type hint;
file "db.cache";

edgambite 11-04-2008 11:12 PM

How do I run my hosts to query ns1 without running named on centos workstation?

edgambite 11-04-2008 11:14 PM

Resolver is the host that is trying to query my nameserver for DNS.

billymayday 11-04-2008 11:25 PM


Originally Posted by edgambite (Post 3332055)
Resolver is the host that is trying to query my nameserver for DNS.

Do you a client machine - ie one not running a nameserver?

edgambite 11-04-2008 11:31 PM

Yes, exactly. My client cannot reach ns1. Nor can my windows machines.

ns1 works with recursion and all others by itself, but is unreachable for clients.

billymayday 11-04-2008 11:33 PM

Can you ping it? Have you opened port 53 on its firewall?


# telnet 53

and see what happens. I'll bet on the firewall blocking requests.

edgambite 11-04-2008 11:38 PM

Unable to connect to remote host: No route to host

All times are GMT -5. The time now is 10:25 AM.