What's wrong with traditional aproach?
In our opinion, DNS configurations are best expressed with simple text files. The problem is that Bind syntax is too noisy and managing tens or hundreds of domains through a web interface is not a pleasant task.
It exploits defaults to the maximum to make configurations simple and clear. Why same thing should be expressed over and over? If we are comfortable with defaults, why we should pollute our configurations? Domain aliases should be expressed easily.
- Why source control ?
When working in teams, ability to track changes (who, when, what) and changes reverting are very important.
- Why scripting ?
Repetitive tasks can be scripted into functions to fight complexity. Lua is a mature scripting language, designed decade ago and used in many large projects.
LuaDNS supports most common Resource Records (RR):
To use LuaDNS platform you'll need a LuaDNS account and a GitHub repository. Follow this easy steps:
- Create a new git repository on GitHub:
- Project Name: dns
- Create a local repository and connect it to freshly created GitHub repository
(replace USER with your GitHub username):
mkdir dns cd dns git init echo 'DNS settings, more on: http://www.luadns.com/' > README.md git add README.md git commit -m 'first commit' git remote add origin email@example.com:USER/dns.git git push -u origin master
- Edit your LuaDNS account and set your source repository
(replace USER with your GitHub username).
- Configure your GitHub repository to notify LuaDNS when you push changes to it,
add a Post-Receive Hook
(Admin -> Service Hooks -> Post-Receive URL):
(You'll find your API-TOKEN under Account settings)
After initial configuration, you are ready to proceed to next step, zone configuration.
We'll show you an example using domain example.com, but you should replace example.com with your domain name.
Change to your git repository created in previous section and add an "example.com" zone to repository to it:
touch example.com.lua templates.lua git add example.com.lua templates.lua
Edit example.com.lua and paste the following content:
-- File: example.com.lua -- Zone: example.com -- _a variable is replaced with zone name "example.com" -- ## GitHub pages example -- More info in "Custom Domains" section here: http://help.github.com/pages/ a(_a, "22.214.171.124") cname("www", "charlie.github.com") -- ## Google Apps example -- We'll host our mail on Google Apps, because we have multiple domains using -- Google Apps, we'll save snippet as a template (Lua function). -- All templates should go to templates.lua file. google_app(_a)
Save the following Lua code to templates.lua:
-- File: templates.lua -- This file is executed before each .lua file -- shared code/templates should reside here. function google_app(domain) -- mail exchangers mx(domain, "aspmx.l.google.com", 5) mx(domain, "alt1.aspmx.l.google.com", 10) mx(domain, "alt2.aspmx.l.google.com", 10) mx(domain, "aspmx2.googlemail.com", 20) mx(domain, "aspmx3.googlemail.com", 20) -- mail.domain.com alias cname(concat("mail", domain), "ghs.google.com") -- SPF record spf(domain, "v=spf1 a mx include:_spf.google.com ~all") end
Now you are ready to to push your DNS configurations to LuaDNS servers through GitHub.
git commit -m "add example.com domain" . git push origin master
git push command, you'll receive an email from LuaDNS.com with the status of your changes.
If everything is OK (domains and records are validated on each push), your domains and records will
be deployed to name servers, if errors are found you'll receive details about the problems
so you can fix them and try again.
Changing name servers at your registrar
After succesfull deployment, you are ready to switch to LuaDNS name servers (more about name servers here):
LuaDNS service was built using many open source technologies. To support open source movement we are offering a special package to open source projects, more info here.
- "Too noisy" when dealing with multiple domains sharing the same records/similar set of records (a common case).