Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to setup a BIND server. I have read some tutorials on the internet, but I have still not got it to work. The OS of the machine that is runnig the BIND daemon is CentOS 6.4 with IP address 192.168.1.13.

In /etc/named.conf I have added these lines:

zone "mydomain.com" IN {
        type master;
        file "mydomain.com.zone";
        allow-update { none; };
};

zone "0.168.192.in-addr.arpa" {
        type master;
        file "mydomain.com.rev";
};

In /var/named/mydomain.com.zone I have this:

$ORIGIN mydomain.com.
$TTL 3D

@       SOA     ns.mydomain.com.     root.mydomain.com. (12 4h 1h 1w 1h)

@       IN      NS      ns.mydomain.com.

ns.mydomain.com.     IN      A       192.168.1.13

www                  IN      A       192.168.1.13

In /var/named/mydomain.com.rev I have this:

$ORIGIN 0.168.192.in-addr.arpa.

$TTL 3D

@       SOA     ns.mydomain.com.     root.mydomain.com. (12 4h 1h 1w 1h)

@       IN      NS      ns.mydomain.com.

211     IN      PTR     ns.mydomain.com

On my other machine I have configured /etc/resolv.conf to contain these lines:

domain mydomain.com
search mydomain.com
nameserver 192.168.1.13

When I run nslookup www.mydomain.com I just get

Server:   192.168.1.13
Address:  192.168.1.13#53

**server can`t find www.mydomain.com.mydomain.com: REFUSED

I have checked with netstat that BIND is listening for all connections, IPTables is not blocking incomming connections and port 53 is open on the BIND server when I run nmap from my other computer.

And, of course, BIND is running.

Have I missed something?

share|improve this question
    
Post the complete /etc/named.conf also check the logfile of BIND if it logged any errors. –  faker Dec 8 '13 at 14:34

1 Answer 1

up vote 0 down vote accepted

First check that your bind configuration is okay:

# named-checkconf
# named-checkzone mydomain.com /var/named/mydomain.com.zone

After that check that you are able to resolve correctly your zone

# dig mydomain.com SOA @localhost

But according to your configuration, it should work fine from the machine which have bind installed on it.

Are you using views? Is this zone in a view? If you are using views you have to make sure that the client trying to resolve from this view is in "match-clients {}"

Next check the following 2 parameters in named.conf:

listen-on port 53 { 192.168.1.13; };
allow-query { any; };

You will have to restart bind after editing.

share|improve this answer
    
named-checkconfgives no output. named-checkzone says mydomain.com configuration is OK. When I run nslookup www.mydomain.com from the BIND machine it seems to work (after editing /etc/resolv.conf). But it still does not work from my client machine. I don´t know what views are. I am totally new to BIND and this is my first step to learn it. I made a fresh install and just edited named.conf and created the other two files (mydomain.com.zone and mydomain.com.rev) so I suppose I do not use any views. –  Rox Dec 8 '13 at 14:15
    
If named-checkconf doesn't give output, then it executed without problems. –  Ahmed Ossama Dec 8 '13 at 14:25
1  
Ok, check the following 2 parameters in named.conf: listen-on port 53 { 192.168.1.13 }; allow-query { any; }; You will have to restart bind after editing. –  Ahmed Ossama Dec 8 '13 at 14:34
    
allow-query { any; }; made it! It was first set to localhost. Thank you! –  Rox Dec 8 '13 at 14:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.