correct master file?

I'm hoping to use bind9 to run DNS myself. It looks like I get the right IP address back from dig @65.19.178.131 brlewis.com, but never having done this before I want to be sure I'm not doing some kind of subtle screwup. Anyone see a mistake in this master file for brlewis.com?

@ IN SOA ns1.brlewis.com. (

2004060101 ; Serial (yyyymmddxx)

86400 ; Refresh (1 day)

7200 ; Retry (2 hours)

604800 ; Expire (7 days)

86400 ) ; Minimum (1 day)

IN NS ns1.brlewis.com.

brlewis.com. IN A 65.19.178.131

www IN CNAME brlewis.com.

ns1 IN A 65.19.178.131

5 Replies

@brlewis:

@ IN SOA ns1.brlewis.com. (

2004060101 ; Serial (yyyymmddxx)

86400 ; Refresh (1 day)

7200 ; Retry (2 hours)

604800 ; Expire (7 days)

86400 ) ; Minimum (1 day)

Aren't you missing an entry in this SOA record? After "ns1.brlewis.com." you need your contact address (with @ converted to .)

The format is

@ IN SOA origin mail.addr (
     serial refresh retry expire ttl)

The line beginning "brlewis.com." may be better of using @ as the name, so it references implicitly the zone you are defining (same as with the SOA record) for consistency. But that's just a matter of taste :-)

I'll defer to someone else's taste. My DNS needs are so normal that I don't think I need to agonize over anything, or even get a deep understanding of all the RFCs.

@ IN SOA ns1.brlewis.com. brlewis.alum.mit.edu (

2004060101 ; Serial (yyyymmddxx)

86400 ; Refresh (1 day)

7200 ; Retry (2 hours)

604800 ; Expire (7 days)

86400 ) ; Minimum (1 day)

IN NS ns1.brlewis.com.

@ IN A 65.19.178.131

www IN CNAME brlewis.com.

ns1 IN A 65.19.178.131

I suppose though I should at least have an MX record. I also added a $TTL line because bind was noting its absence in syslog (falling back on min ttl).

$TTL 1d
@ IN  SOA  ns1.brlewis.com. brlewis.alum.mit.edu (
                2004061501 ; Serial (yyyymmddxx)
                86400      ; Refresh (1 day)
                7200       ; Retry (2 hours)
                604800     ; Expire (7 days)
                86400 )    ; Minimum (1 day)

                IN      NS      ns1.brlewis.com.

@                       IN      A       65.19.178.131
@                       IN      MX 50   65.19.178.131
www                     IN      CNAME   brlewis.com.
ns1                     IN      A       65.19.178.131
ns2                     IN      A       65.19.178.131

A quick glance and there's a few things. FIrstly, MX records should point to A records, not to IP addresses…

% nslookup -silent -type=mx brlewis.com 65.19.178.131
Server:         65.19.178.131
Address:        65.19.178.131#53

brlewis.com     mail exchanger = 50 65.19.178.131.brlewis.com.

There are a couple of minor points you may not be aware of. The first is that since you have multiple entries for "@" they can all be collapsed into one.

The second is the CNAME for www. Because it's a CNAME you now also have MX records, NS records and SOA records for the "www" name etc etc

% nslookup -silent -type=mx www.brlewis.com 65.19.178.131
Server:         65.19.178.131
Address:        65.19.178.131#53

www.brlewis.com canonical name = brlewis.com.
brlewis.com     mail exchanger = 50 65.19.178.131.brlewis.com.

It's just a minor point :-)

What I would do is:

$TTL 1d
@ IN  SOA  ns1.brlewis.com. brlewis.alum.mit.edu (
                2004061601 ; Serial (yyyymmddxx)
                86400      ; Refresh (1 day)
                7200       ; Retry (2 hours)
                604800     ; Expire (7 days)
                86400 )    ; Minimum (1 day)

                IN      NS      ns1.brlewis.com.
                IN      A       65.19.178.131
                IN      MX 50   mail.brlewis.com.

; We use the same IP address a lot, because we use different
; names for the same service.  We could just have 
; "linode.brlewis.com" as the one name, but...
www                     IN      A       65.19.178.131 
ns1                     IN      A       65.19.178.131
ns2                     IN      A       65.19.178.131
mail                    IN      A       65.19.178.131

Note that the same IP address is used in lots of places now. As the comment says, we could reduce it and just have it twice (an A record for the @ line, and an A record for a general line (eg "linode") and have everything (NS, MX,WWW) all point to that. That's just a matter of taste :-)

And don't forget to do everybody a favor and create an SPF record. ;)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct