1

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       184.82.142.241
ns1     IN      A       184.82.142.241
www     IN      CNAME       odie5533.com.

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

options {
        directory "/var/cache/bind";
        forwarders {
                    184.82.142.241;
        };
        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.

1
  • How is this a "private" nameserver? What does "ultimately unsuccessful" actually mean?
    – womble
    Jul 30, 2011 at 4:53

1 Answer 1

3

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 184.82.142.241 isn't running an SMTP server, and given that the domain lacks any MX records, [email protected] 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.

1
  • 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, 2011 at 13:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .