Adding a Domain Name Server to Bind

  1. Find the name server for the new domain with the dig utility. For example, to find the name server for dyndns.org, type "dig dyndns.org" from the bash command line. The output will look like:
    ; <<>> DiG 9.3.2 <<>> dyndns.org
    ;; global options: printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7678
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 5

    ;; QUESTION SECTION:
    ;dyndns.org. IN A

    ;; ANSWER SECTION:
    dyndns.org. 83084 IN A 63.208.196.110

    ;; AUTHORITY SECTION:
    dyndns.org. 83084 IN NS ns5.dyndns.org.
    dyndns.org. 83084 IN NS ns1.dyndns.org.
    dyndns.org. 83084 IN NS ns2.dyndns.org.
    dyndns.org. 83084 IN NS ns3.dyndns.org.
    dyndns.org. 83084 IN NS ns4.dyndns.org.

    ;; ADDITIONAL SECTION:
    ns1.dyndns.org. 77377 IN A 63.208.196.90
    ns2.dyndns.org. 77377 IN A 204.13.249.81
    ns3.dyndns.org. 77377 IN A 204.13.250.81
    ns4.dyndns.org. 77377 IN A 213.155.150.205
    ns5.dyndns.org. 77377 IN A 63.170.10.81

    ;; Query time: 1 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Thu Jul 20 14:30:48 2006
    ;; MSG SIZE rcvd: 214
  2. open the named.ca file:
    1. find the line where directory is defined in named.conf. It should look something like:
      directory "/var/bind";
    2. cd to this directory
    3. open the file named.ca in a text editor
  3. create a new entry for this domain. The easiest way is to copy a previous entry, and substitute the dns server, and ip addresses which were found by the dig command. For example:
    . 3600000 NS ns1.mydyndns.org.
    ns1.mydyndns.org. 3600000 A 63.208.196.92
  4. reload the bind's cache by typing "rndc reload"
  5. test the new name server with nslookup. For example, "nslookup ewted.dyndns.org". nslookup should give output like:
    Server: 127.0.0.1
    Address: 127.0.0.1#53

    Non-authoritative answer:
    Name: newted.dyndns.org
    Address: 66.18.227.242