romeo
romeo

Reputation: 191

Setting up bind9 DNS forward lookup

I'm trying to configure a forward lookup zone file to do the following

Below is my code, but I don't know what I'm doing. I've tried to google and follow the bind9 ubuntu guide. But it's giving me nothing .. ideas?

    $TTL    604800
    @       IN      SOA     ns.mountains.com. root.mountains.com. (
                                  2         ; Serial
                             604800         ; Refresh
                              86400         ; Retry
                            2419200         ; Expire
                             604800 )       ; Negative Cache TTL
    ;
    @       IN      NS      ns.mountains.com.
    @       IN      MX      mail.mountains.com.
    ns  IN      A       192.168.0.10

    imap    IN      CNAME   mountains
    www     IN      CNAME   mountains
    smtp    IN      CNAME   mountains

    mountains   IN      A       192.168.0.10

Upvotes: 0

Views: 369

Answers (1)

Cody
Cody

Reputation: 639

Use command line tool named-checkzone to check if the zone file is valid.

@ is an abbreviation of $ORIGIN of which the default value is assigned by zone in file named.conf.

In the codes you provided

@ IN MX mail.mountains.com.

lacks preference. Assume we have

@ IN MX 1 maila.mountains.com.

and

@ IN MX 2 mailb.mountains.com.

, then maila will be choosed first. Also an A record will be needed for the mail server.

The following is my understanding of resource record (RR). I don't guarantee the information is 100% correct, but it's enough for a primitive setup of named.

@       IN      SOA     ns.mountains.com. root.mountains.com. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL

is equivalent to

@ IN SOA ns.mountains.com. root.mountains.com. 2 604800 86400 2419200 604800

The parentheses are just for line-continuing.

All RRs have the same form.

Question TimeToExpire IN RRType Answer

These 5 fields are separated by one or more continuous spaces. If there are more spaces left, they will all be considered a part of the 5th field.

The 3rd field IN is just the abbreviation of internet.

The first 3 fields can be omitted. If any of them are omitted, then the values on the same fields from the last RR will be used.

All domain names without a trailing dot will be appended with the $ORIGIN as their suffix. So, assume the origin is mountains.com,

ns IN A 192.168.0.10

is equivalent to

ns.mountains.com. IN A 192.168.0.10

Upvotes: 1

Related Questions