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

I have a few domains I want pointed to a VPS, and I'd like them to use the VPS as their nameserver so that each is ns1.example.com and ns2.example.com. The nameserver is thus at the same IP as the web server. My domain is hosted at 1and1 which may or may not have any relation. I tried following http://www.newmediapower.com/blog/setting-up-your-own-dns-server-with-bind9/ and http://mysql-apache-php.com/dns-server-tutorial.htm but was ultimately unsuccessful.

Here is my /etc/bind/db.odie5533.com file:

$TTL    604800
odie5533.com.   IN      SOA     ns1.odie5533.com. admin.odie5533.com. (
                              16        ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
odie5533.com.   IN      NS      ns1.odie5533.com.
@       IN      A
ns1     IN      A
www     IN      CNAME       odie5533.com.

Here is my /etc/bind/named.conf.options file:

options {
        directory "/var/cache/bind";
        forwarders {
        query-source address * port 53;
        notify-source * port 53;
        transfer-source * port 53;
        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };

And here is my /etc/bind/named.conf.local file:

zone "odie5533.com" {
        type master;
        file "/etc/bind/db.odie5533.com";

If anyone can tell what I'm doing wrong I'd greatly appreciate it. Thanks.

share|improve this question
How is this a "private" nameserver? What does "ultimately unsuccessful" actually mean? –  womble Jul 30 '11 at 4:53

1 Answer 1

up vote 3 down vote accepted

Well, you've got at least one major screwup in your zone file: An A record takes an address, not another name, so

www     IN      A       odie5533.com.

is completely wrong. Try making in a CNAME, or changing the rrdata to an IP address.

Also, running both your nameservers off the same IP is... well, PG-rated words fail me. Suffice it to say, stop that. There are thousands of free secondarying services.

It appears that isn't running an SMTP server, and given that the domain lacks any MX records, admin@odie5533.com is an invalid e-mail address. Best to fix that, too.

Running a squish over odie5533.com for A records gives me a SERVFAIL, so something's fundamentally screwed in your nameserver config. The bits that you've given seem OK, but what is actually including /etc/bind/named.conf.local? That may not be present in your named.conf (we can't tell, you haven't provided it).

Make sure you actually restarted bind after dropping in all this config, and make sure there isn't something else that's, say, setting allow-query to something restrictive. It's also not good practice to run a recursive and authoritative nameserver in the same process.

Finally, check your logs. They'll almost certainly be able to provide you with the reason why whatever's going wrong is going wrong.

share|improve this answer
Overnight I redid the DNS entries on my registrar, 1and1, and pointed another domain to my VPS with GoDaddy. Along with your CNAME record fix, both are properly working this morning. Thank you. I plan to use a secondary DNS service as well, but don't really see much point. I'm still working on the email since I'd rather not host email myself (don't want to lose emails), but am not completely sure how to hook up the MX entries so that they don't require my VPS to be on to direct email. –  odie5533 Jul 30 '11 at 13:14

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.