Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I am trying to set up a DNS server on Amazon Linux using BIND9. It has to act as a master nameserver for a lot of domains.

I have imported all of the DNS zone files using NamedManager (a web interface that creates bind configration files).

My /etc/named.conf is as follows:

options {
    listen-on port 53 { any; };
    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     { any; };
    allow-recursion {; };

include "/etc/named.namedmanager.conf";

zone "." IN {
        type hint;
        file "";

My /etc/named.namedmanager.conf (the auto-generated files) is as follows:

zone "" IN {
        type master;
        file "";
        allow-update { none; };
zone "" IN {
        type master;
        file "";
        allow-update { none; };
// ... more zones

My /var/named/

$TTL 120
@               IN SOA (
                        2013111005 ; serial
                        21600 ; refresh
                        3600 ; retry
                        604800 ; expiry
                        120 ; minimum ttl

; Nameservers   86400 IN NS

But when I try to resolve using this DNS server from home I get the following:

[me@myhomepc ~]$ host
Using domain server:
Address: <my-nameserver-ip>#53

Host not found: 5(REFUSED)

I tried disabling recursion for (recursion no; in options{}), as I need to be my nameserver to be serving results. In that case I don't get REFUSED but I don't get any answer!

share|improve this question
If you use nc does it form a tcp connection on port 53? – Bratchley Nov 16 '13 at 23:44
[me@mypc ~]$ nc 53 gives no output. How do I know? – Qualcuno Qui Nov 16 '13 at 23:50
try nc -vz 53 if it's the old version nc -v 53 if it's the newer one – Bratchley Nov 16 '13 at 23:51
Usually no output means it didn't connect, though. – Bratchley Nov 16 '13 at 23:52
I thought that 5(REFUSED) meant that the server accepted our connection but is refusing to reply to us? – slm Nov 17 '13 at 3:31

2 Answers 2

The config files look OK except that in the file /var/named/ you need to put an A record for, something like this:

Add this line in /var/named/   IN   A   x.y.z.t

and don't forget to update the serial at the beginning of the file and then restart or reload the named service.

share|improve this answer

The name you are looking up is not part of any zone that you have.

The zone that you have configured is named but you are trying to look up the name

In addition to this it looks like there is out of zone data inside the zone, but I can only assume that the problem here is actually the zone name.

For any additional errors you may want to look at your logs and/or named-checkconf -zj output.

share|improve this answer
(Yes, I know this is and old question but it had been autobumped and the answer hadn't been posted, maybe it can help someone else.) – Håkan Lindqvist Jun 24 '14 at 6:29

Your Answer


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.