richie
richie

Reputation: 189

bind9 answering SERVFAIL

I've just set up my debian squeeze server. But now i got a little Problem, i cant reach my server through my domain (in this case example.com).

I also registered a nameserver with namecheap which is "connected" to my server ip.

This is my bind9 named.conf

zone "." {
        type hint;
        file "/etc/bind/db.root";
};

zone "localhost" {
        type master;
        file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
        type master;
        file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
        type master;
        file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
        type master;
        file "/etc/bind/db.255";
};

options {
    directory "/var/named";
};

zone "example.com" {
    type master;
    file "e/example.com";
};

And this is the corresponding zone file which is located in "/var/named/e/"

$TTL 2H
@       IN      SOA     ns1.example.tld. hostmaster.example.tld. (
                        1328627781                      ; serial
                        8H                              ; refresh
                        2H                              ; retry
                        4W                              ; expire
                        2H )                            ; minimum TTL

                NS      ns1.example.tld.                 ; name server
                NS      ns2.example.tld.                 ; name server
                MX      10 mail.example.org.             ; mail exchanger
                A       MY_SERVER_IP_ADDRESS
*               A       MY_SERVER_IP_ADDRESS
mail            A       MY_SERVER_IP_ADDRESS
www             A       MY_SERVER_IP_ADDRESS

If i do a nslookup

nslookup stackoverflow.com 8.8.8.8
Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
Name:   stackoverflow.com
Address: 64.34.119.12

Everything is showing up correctly of course.

And now for my example.com domain

nslookup example.com 8.8.8.8
Server:         8.8.8.8
Address:        8.8.8.8#53

** server can't find example.com: SERVFAIL

Could someone help me? Because i dont know where i should start to find the problem.

Thank you so much in advance

Upvotes: 1

Views: 9753

Answers (2)

jingchun.zhang
jingchun.zhang

Reputation: 81

You should not forget the ns A or AAAA record. It is the glue record.

https://www.cloudaccess.net/cloud-control-panel-ccp/157-dns-management/318-glue-records.html

Upvotes: 1

airween
airween

Reputation: 6193

When you ask the stackoverflow.com from 8.8.8.8 nameserver, it asks the info about this domain recursively. It means, first it goes to one of the root servers, asks ".com" nameservers, then goes one of them, asks "stackoverflow.com" info.

If you get this answer (can't find example.com), that probably means you didn't registered your domain at a domain registrar.

Upvotes: 2

Related Questions