Results 1 to 6 of 6

Thread: Bind9 configuration for single word domain names

  1. #1
    Join Date
    Feb 2007
    Location
    Apeldoorn, NL
    Beans
    595
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Bind9 configuration for single word domain names

    I have been attempting to configure bind9 in such a way that I can ssh/browse to systems on the local network using single word domain names. E.g., typing synology1 in a webbrowser or ssh synology1 in a terminal should bring me to the right place.

    However, with my current configuration (see below), it doesn't work. The first time, a dot needs to be added to the domain name (e.g. "synology1."). After that, simply typing "synology1" works correctly. This behavior is probably related to the fact that a single word without a dot is not a fully qualified domain name. However, I still wonder whether there's a solution to this, as - for example - many routers do seem to have this feature.

    db.synology1 looks as follows:

    Code:
    @ IN SOA ns.server root.synology1 (
    201003096 ; serial
    8H ; refresh
    4H ; retry
    4W ; expire
    1D ) ; minimum
    
    @ IN NS ns.server
    ns.server IN A 192.168.1.15
    @ IN A 192.168.1.5

  2. #2
    Join Date
    Apr 2006
    Location
    Adelaide, Australia
    Beans
    826
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Bind9 configuration for single word domain names

    I know this is probably not the way you want to do it, but why not use the /etc/hosts file, and put the necessary entry in that.

    It will cause a problem if the IP address in the DNS records ever changes; I understand that, but it is a way around it.
    "Strive to be the person your dog thinks you are"

  3. #3
    Join Date
    Feb 2007
    Location
    Apeldoorn, NL
    Beans
    595
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Bind9 configuration for single word domain names

    Quote Originally Posted by HereInOz View Post
    I know this is probably not the way you want to do it, but why not use the /etc/hosts file, and put the necessary entry in that.

    It will cause a problem if the IP address in the DNS records ever changes; I understand that, but it is a way around it.
    Well, adding the "." at the end isn't that much of a problem, and it actually works well I suppoze. It just seems a bit silly that it is neccesary, and I don't understand why it somewtimes won't and sometimes will work without adding the final dot.

  4. #4
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    2,395
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Bind9 configuration for single word domain names

    The "dot" at the end is proper bind syntax for the db file. Your posted file is missing 3 "dots", and also missing a TTL declaration.
    I have no comment about the trying to use single domain names part. You should be able to use one domain name and still be able to use one word only to specify which computer on your lan you desire. My internal lan, using bind, works that way. Example:
    Code:
    doug@s16:~$ ping s15
    PING s15.smythies.com (192.168.111.112) 56(84) bytes of data.
    64 bytes from s15.smythies.com (192.168.111.112): icmp_req=1 ttl=64 time=0.296 ms

  5. #5
    Join Date
    Feb 2007
    Location
    Apeldoorn, NL
    Beans
    595
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Bind9 configuration for single word domain names

    Quote Originally Posted by Doug S View Post
    The "dot" at the end is proper bind syntax for the db file. Your posted file is missing 3 "dots", and also missing a TTL declaration.
    I have no comment about the trying to use single domain names part. You should be able to use one domain name and still be able to use one word only to specify which computer on your lan you desire. My internal lan, using bind, works that way. Example:
    Code:
    doug@s16:~$ ping s15
    PING s15.smythies.com (192.168.111.112) 56(84) bytes of data.
    64 bytes from s15.smythies.com (192.168.111.112): icmp_req=1 ttl=64 time=0.296 ms

    I see. This seems a much better solution. Can you give a hint about how to get this working? I would be really grateful if you would be willing to post the bind9 configuration file that takes care of this.

  6. #6
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    2,395
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Bind9 configuration for single word domain names

    To have abbreviated computer names lookup properly on your LAN you need to do two things: Have bind working properly; Have your client and server computers know to add the domain name extention to the DNS request when using abbreviated names.

    For the bind part refer to the Ubuntu 12.04 server guide DNS chapter, this thread and, perhaps, this thread. There are examples of bind db files in those threads.

    For the client computers, when I typed:
    Code:
    doug@s16:~$ ping s15
    The DNS request that was sent was this:
    Code:
    2012-10-10 16:38:31.091201 IP 192.168.111.113.35437 > 192.168.111.1.53: 62927+ A? s15.smythies.com. (34)
    Where you can see that the "smythies.com" part was added by the computer "s16".
    For clients that get their IP lease via DHCP, this should work.
    For clients that use static IP addresses, they might need a dns-search directive added to the etc/network/interfaces file (I think. I don't have any static clients). Or, if you are using an older version of Ubuntu, where /etc/resolv.conf doesn't get overwritten, a search directive can be added there.
    For my server itself, sometimes it works and sometimes not. I was trying to figure it out today, but now it is working. Currrently my resolv.conf file (which get created from other stuff) is:
    Code:
    doug@doug-64:~/config/network$ cat /etc/resolv.conf
    nameserver 127.0.0.1
    nameserver 75.153.176.9
    nameserver 75.153.176.1
    nameserver 75.153.176.1
    domain smythies.com
    search smythies.com
    Hope this helps, and let us know how it goes. I'll add to this thread if I remember something I forgot to mention. There is another good thread about this stuff that I have not found yet.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •