should i add an additional dns name to the zone for nameserver instead of using just its default hostname?

0

On a BIND install for a machine that is hostnamed falcon here is my(only) zone file for my LAN web development environment.

$ cat /var/named/ld.pvt.zone
@                               IN SOA   ns01.ld.pvt. admin.ld.pvt. (
                                    2015122202      ; serial (yyyymmdd##)
                                    1D     ; refresh
                                    1H    ; retry
                                    1W     ; expiry
                                    3H )   ; minimum ttl

                                NS  ns01.ld.pvt.
                ns01            IN      A       192.168.1.10
                falcon.         IN      CNAME   ns01

I dont need the hostname ns01, i was adding it for convenience, and because the tutorials all have it that way. Im also not really sure where i need to put the dots after hostnames. I only need the hostname falcon.ld.pvt available on my lan. following tutorials i have adopted in this ns01 name, but can i eliminate it, and still have a proper setup that will be looked at and easily understood by someone else?

e.g. what if i just used my preferred hostname(falcon)

@                               IN SOA   falcon.ld.pvt. admin.ld.pvt. (
                                    2015122202      ; serial (yyyymmdd##)
                                    1D     ; refresh
                                    1H    ; retry
                                    1W     ; expiry
                                    3H )   ; minimum ttl

                                NS  falcon.ld.pvt.
                falcon            IN      A       192.168.1.10

Is this normal, or wrong?

Now if this will work, when i go to add CNAME's foe my websites that are being hosted on this server, will the be accessible still?

e.g. adding the following, will there be any problems to spin-up a new site without needing to edit the drivers/etc/hosts file on their windows machines, so long as their pointing to this bind server? (routing through www for ease)

            www             IN      A       192.168.1.10
            newsite.        IN      CNAME   www
            another-site.   IN      CNAME   www

http://newsite.ld.pvt 200 ok http://another-site.ld.pvt 200 ok

Can i do it that way?

Brian Thomas

Posted 2015-12-23T02:27:15.670

Reputation: 161

Answers

1

You don't have to use ns01, you can use just falcon instead. At least one NS record is required to avoid generating an error ("no NS for zone ...") and fail to start. Two or more NS records are required for a "real" DNS zone, i.e., one that's registered and resolvable on the public Internet (but this of course is not).

Trailing dots are extremely important in zone files. So far, what you have is correct. Any domain name without a trailing dot will have the current origin appended. In this case it's "@", which translates to the name in the "zone" directive in the configuration file (not shown), but I assume is "ld.pvt". However, you do have "newsite." and "another-site." which, to be clear, will be interpreted as-is with the trailing dots. That is, in a browser on a machine using this DNS server, you'd specify http://newsite/, so yes, you can do it that way.

milli

Posted 2015-12-23T02:27:15.670

Reputation: 1 682

crap, i was aiming for http://newsite.ld.pvt, this was my wole point of the BIND install, to subdomain out my development sites on falcon (aka ld.pvt) so remove the dots there?

– Brian Thomas – 2016-01-06T19:06:34.907

If you remove the trailing-dots from newsite. and another-site., then ld.pvt will be appended to them, and you get newsite.ld.pvt. and another-site.ld.pvt. (implied FQDNs - fully-qualified domain names). – milli – 2016-01-13T16:04:02.577