TinyDNS Format

From Alpine Linux
Revision as of 18:42, 10 July 2012 by Wmjohnso (Talk | contribs) (Added AAAA Records)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

TinyDNS data file

The offical data format for tinydns data is documented in http://cr.yp.to/djbdns/tinydns-data.html See notes at bottom for more information on certain fields.

SOA Record



Question: Zmy.example.net.
my.example.net. +2560 soa abuse@example.net. 1206390017 16384 2048 1048576 2560


my.example.net. +2560 soa abuse@example.net. 2008032201 1000 2000 3000 4000

A, NS record combined


Creates an A and NS record. Typically used to delegate a subdomain; can be used in combination with Z to accomplish the same thing as the combo above, but with a different email address.


# Question: Zmy.example.net.
# NS replies:
my.example.net. +259200 ns something.ns.my.example.net.
# AR replies:
#something.ns.my.example.net. +259200 a


# Question: Zmy.example.net.
# NS replies:
my.example.net. +3600 ns ns1.somewhere.com.
# AR replies:
#ns1.somewhere.com. +3600 a

A and PTR record



Question: Zalpha.my.example.net.
alpha.my.example.net. +86400 a

# Question: Z1.1.168.192.in-addr.arpa. +86400 ptr alpha.my.example.net

For the PTR record to be returned, you must have the corresponding SOA record defined:



A record



Question: Zalpha.my.example.net.
alpha.my.example.net. +86400 a

MX Record



Question: @my.example.net.
my.example.net. +86400 mx 0 something.mx.my.example.net.


Question: @my.example.net.
my.example.net. +86400 mx 10 mx1.my.example.net.
my.example.net. +86400 mx 20 mx2.my.example.net.
# AR replies:
#mx1.my.example.net. +86400 a
#mx2.my.example.net. +86400 a




Question: Zmailserver.my.example.net.
mailserver.my.example.net. +86400 cname yourmailserver.somewhere.com.



'my.example.net:Please do not bug us we know our DNS is broken

Question: Tmy.example.net
my.example.net. +86400 txt 'Please do not bug us we know our DNS is broken'



Standard rules for ip, x, ttl, and timestamp apply. Port, priority, and weight all range from 0-65535. Priority and weight are optional; they default to zero if not provided.


query: 33 console.zoinks.example.com
answer: console.zoinks.example.com 300 SRV 7 69 2001 rack102-con1.example.com



The same standard rules for ttl and timestamp apply. Order and preference (optional) range from 0-65535, and they default to zero if not provided. Flags, service and replacement are character-strings. The replacement is a fqdn that defaults to '.' if not provided.


query: 35 somedomain.org
answer: somedomain.org 78320 NAPTR 100 90 "s" "SIP+D2U" "" _sip._tcp.somedomain.org




These records are used to resolve IPv6 addresses.


query: alpha.my.example.net   IN         ANY
answer: alpha.my.example.net. 86400 IN	AAAA	2801:4300:c23a:3f:452a:34ed:ae34:3354


Each line starts with a character, and continues with colon separated fields. Spaces and tabs at the end of a line are ignored. Blank lines are also ignored.

timestamp is an optional TAI64 (hex format) timestamp. If the timestamp is given the ttl has special meaning:

  • If ttl is nonzero or omitted, then the timestamp is when this record goes "live"
  • if ttl is zero, then the timestamp is the "time to die", when the record is no longer to be served. Tinydns will dynamically adjust the ttl so that the DNS records are not cached beyond the "time to die"

lo is an optional location field. The record is ignored if the client is outside that location. lo can be one or two characters. For example,


specifies www.mydomain.com has address for clients in the address range, and for all other clients.

In lines with "x", if "x" contains a dot, then "x" is used as the server name rather than "x".[something].fqdn You should omit ip if x has IP addresses assigned elsewhere in the data file.

Wildcards in the form of *.fqdn are allowed, and will resolve any address EXCEPT those that have their own records, or more specific wildcards.


Will send the user to his local machine for foo.mydomain.com, mx.mydomain.com, in fact ANYTHING .mydomain.com, except www.mydomain.com