Network

DNS

8.8.8.8
8.8.4.4
2001:4860:4860::8888
2001:4860:4860::8844
208.67.222.222
208.67.220.220
2620:0:ccc::2
2620:0:ccd::2

DNS Record

bar.example.com.        CNAME  foo.example.com.
foo.example.com.        A      192.0.2.23
@                  IN   TXT    "some text"

RR: DNS Resource Record

A DNS zone file contains the list of all Resource Records in the DNS zone. Format is defined in RFC1035 page 33 with an addendum in RFC2308. A unique SOA RR and at least one NS RR for the zone name are required. A complete RR is a quintuplet {FQDN_NAME, TTL, CLASS, TYPE, RDATA} which can be in abbreviated form in some cases.

  • Comments start with a semicolon ; and go to the end of line.

  • Empty lines are allowed; any combination of tabs and spaces acts as a delimiter.

  • RR are defined line by line as :

  • [Name] [TTL] [CLASS] TYPE RDATA

    • if no Name, the name is taken from the last stated RR

    • if Name exists, it starts at the first character of the line

    • if Name is not dot-terminated (non FQDN), the default domain name defined by $ORIGIN directives is concatenated to Name

    • if no TTL, the TTL is defined by $TTL directives.

    • if no CLASS, the CLASS is taken from the last stated RR

    • TTL and CLASS can be exchanged.

  • $TTL integer_value sets the default value of TTL for following RRs in file (RFC2308, bind>8.1)

  • $ORIGIN fqdn_name sets the default value of domain name for following RRs in file. Initially, in BIND, the value is set to the current zone name.

  • $INCLUDE filename inserts the named file into the current file. NB: be careful about value of $TTL or $ORIGIN after a $INCLUDE

  • @ is used to denote the current default domain name.

  • ( and ) are used to group data that crosses a line boundary. Line terminations are not recognized within parentheses

  • \ is used to quote special characters. Ex : \. can be used to place a dot character in a label; \223 is the 8-bit character corresponding to decimal value 223.

Stylistic hints:

  • Organize RR : Start with SOA, NS and MX of the zone, continue with delegation (NS) and glue. Group RR by names.

  • Comments are useful

  • Use spaces or tabulations for vertical alignment

  • Start file with a $ORIGIN and a $TTL

  • Try to avoid writing of the zone name in the file

  • Generate serial number in SOA as : year/month/day/version 4+2+2+2.

  • BE CAREFUL: Modify the serial number each time the master file is modified

CNAME can't be used for apex domain (aka bare domain or naked domain, ex: example.com):

See also:

Wake-on-LAN

IP address

http://1089053027 is translated to http://64.233.161.99/ (then the server redirect to Google Search homepage) 32-bit url 0x1000000111010011010000101100011 == 1089053027 == (64 << 24) + (233 << 16) + (161 << 8) + 99

Supported in Firefox, Chrome, IE

Last updated