User Tools

Site Tools



Tinydns is a DNS server. It accepts iterative DNS queries from hosts around the Internet, and responds with locally configured information. D. J. Bernstein :

That a very good choice for makeing a dns server, the openwrt package is amazing, and have really integrate tinydns on openwrt. Tinydns is very nice for make small domain, and have capability to grow without major change. Compare to Bind design deployment that the day and the night. You should consider djbdns tools and the amazing work done by the packager of Djbdns

Install tinydns

Tinydns is all ready aviable on OpenWrt, you can use opkg tool for install it:

opkg update
opkg install djbdns-base djbdns-tinydns

Configuration file


It file contain informations about you Domain Name store in tinydns-data format, it format is describ by the author here

The logic is simple the each line define a thing, and the frist letter of each line is a Flag it define the Type.

  • The djbdns-tinydns package provide it file as exemple for make you first tests. You have to edit it file for put you own setting as describ on it document.
  • On tipical djbdns deploiement it file is convert to binary cdb format and store in memory, all that work is done via /etc/init.d/tinydns script on OpenWrt.
  • Take care about you SOA serial number, each time you change something you have to increase it number. It is not done by the /etc/init.d/tinydns script.

SOA Serial notes:

Few admins system like put Epoch (reference date) as SOA serial number, and that a good practice. An other practice can be add +1 each to the SOA Serial number, that work too. That a arbitral value the DNS standard require to add +1 as minimum, that because lot of dns servers will ignore and nor relay you new data file. You can choose to never update it serial if you have only one DNS server at home, but that a bad pratice name “poor design” That the frist cause of mistake increase you SOA manually at all

UCI integration

The entire djbdns tools have true UCI integration, here what uci store for tinydns

root@openwrt:/# uci show djbdns | grep 'tinydns\|global'

djbdns.@global[0].runasuser define with which user the /etc/init.d/tinydns script will execute all djbdns tools.

djbdns.@global[0].runasgroup define with which group the /etc/init.d/tinydns script will execute all djbdns tools.

djbdns.@tinydns[0].logging it's the same as export the environement Variable DEBUG before start /etc/init.d/tinydns script. It enable a a mode where init tinydns write it activity.

djbdns.@tinydns[0].interface init script will determine the ip of the interface set here.

For the entire list of what djbdns uci store:

root@openwrt:/# uci show djbdns

Script provide by djbdns

tinydns come with several script it can help you to configure your /etc/tinydns/data file.

Usage of they script will be describe later on it document, for the complet howto follow it link:






What a tipical conf can be

All IP use for they exemples should be change for you own IP

They docs declare each time the last MX to a antispam black list, that a good practice, same for spf txt entry.

The Reverse address is declare like that for a Local Area Network, in case you use IP public to a Wide Area Network the reverse entry should be done via an ISP (Internet Provider) tool, general a web interface, or a Incident Ticket.

Minimal setting for a personal usage:

#Exemple Web servers
#Mail Server

Multi NS , Multi MX exemple:

#Web servers
#Ntp servers
#Mail Server

Test you installation

Open a terminal session on you machine, export a env variable name DEBUG, then start/restart the tinydns init script.

export DEBUG="1"; /etc/init.d/tinydns restart
Restarting Authoritative nameserver: tinydns... 
Stopping Authoritative nameserver: tinydns .
Starting Authoritative nameserver: tinydns
starting tinydns

The tinydns server restart, but keep the hand, now you can test from an other machine or a other terminal session.

The exemple for make the test is done with djbdns “dnsq” tool but it work with “dig”,“nslookup”, or all other resolver you like.

155 bytes, 1+1+3+3 records, response, authoritative, noerror
query: 1
answer: 86400 A $IP_ADRESS_MAIL
authority: 259200 NS
authority: 259200 NS
authority: 259200 NS
additional: 259200 A $IP_ADRESS_NS1
additional: 259200 A $IP_ADRESS_NS2
additional: 259200 A $IP_ADRESS_NS3

From you frist terminal, you should see tinydns recive and reply to the request

c0a8010f:bc4b:3a0c + 0001
stats 1 1 0 0 0 0 0

That mean it work, but remenber to back to the normal, because when you'll leave you terminal session tinydns will die with it.

On you first terminal session use the combinaison key “Control + C” for close tinydns then:

root@openwrt:/root# unset DEBUG; /etc/init.d/tinydns restart
Restarting Authoritative nameserver: tinydns... 
Stopping Authoritative nameserver: tinydns .
Starting Authoritative nameserver: tinydns

The tinydns restart and give back the hand, if you have enable the service at startup you'll be a enjoy guy :)

Have you own domain name :

It's possible to have you own domain for free by exemple with : , but generally you have to pay to a registar a lease for you domain.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
docs/guide-user/services/dns/tinydns.txt · Last modified: 2018/03/03 20:15 by bobafetthotmail