1

I can't configure BIND to resolve example.org with it sub-domains.

I have local network with single server (LAN IP ADDRESS L.L.L.L and WAN: W.W.W.W) with NGINX, configured for several virtual servers.

I register 2-nd level domain (for example) example.org. I specified name servers for it: ns1.example.com and ns2.example.com which looks on my WAN address.

I need that domains:

  • example.org
  • test.example.org
  • hello.example.org

and so on, were be aligned to my servers IP address.


OK, I have wrote this config in db.example.org

  1 $TTL 3600
  2 @   IN  SOA ns1.example.org. hostmaster.example.org. (
  3             20040603
  4             3600
  5             900
  6             3600000
  7             3600 )
  8 
  9 @ IN NS ns1.example.org
 10 @ IN NS ns2.example.org
 11 
 12 @ IN A W.W.W.W
 13 www.example.org.   IN  A   W.W.W.W
 14 
 15 ns1.example.org.        IN A   W.W.W.W
 16 ns2.example.org.        IN A   W.W.W.W
 17 
 18 subdomain.example.org.  IN  CNAME   www.example.org.
 19 test.example.org.  IN  CNAME   www.example.org.
 20 
 21 

It works, but whether it is fully correct? (W.W.W.W - my IP address) Can I avoid 9 and 10 lines?

1
  • The question is awfully vague: you do not indicate what you tried and the results you obtained. It seems you need to start with a basic BIND tutorial such as wiki.archlinux.org/index.php/BIND
    – bortzmeyer
    Feb 3, 2013 at 16:07

1 Answer 1

3

You do need the NS lines, otherwise BIND wouldn't know that it's the authoritative server.

Lines 13 through 19 could be replaced with * IN A W.W.W.W, which does exactly what it looks like.

Note 1: Many registrars no longer require two NS servers, though at least 3 is HIGHLY recommended, and there are free secondary services around (I use http://buddyns.com, no affiliation).

Note 2: Make sure you're updating that serial number EVERY TIME you change the zone file. Looks like you copied an example that was written in 2004. It's extremely common for BIND Admins to use the Serial format YYYYMMDDRR (YYYY = Year, MM = Month, DD = Day, RR = Revision).

1
  • Note 3: You're 'expire' time in your SOA is set to 1000 hours (3600000), which is just plain odd. "604800" is 1 week, and likely the most commonly used value. It's somewhat important to understand those values before changing them, as they'll effect how/if people can reach your website.
    – Chris S
    Feb 3, 2013 at 16:59

You must log in to answer this question.

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