DNS zones¶
In order to manage DNS zones you need to add domain first using satan domain add example.com command and enable DNS support with satan domain enable dns example.com, where example.com is the name of the domain. You also must set appropriate name servers at your domain provider to pinpoint Rootnode DNS servers. Remember this operation can take up to 24 hours.
Syntax¶
The syntax is as follows:
satan dns add a <domain> <host> <ip>
satan dns add cname <domain> <host> <destination>
satan dns add mx[<priority>] <domain> <host> <destination>
satan dns add txt <domain> <host> "<value>"
satan dns add srv <domain> <_service._protocol> "<priority> <weight> <port> <destination>."
satan dns del <id>
satan dns list
satan dns list <domain>
Syntax can be displayed anytime by typing satan dns help.
| Command | Description |
|---|---|
| satan dns add a <domain> <host> <ip> | Add an A record to the <domain>. The <host> expect the host name can have 2 values: + sign or ^ sign where + means the wildcard (* in BIND notation) and ^ means empty or main entry for domain (@ in BIND notation). Details can be found below. Last argument is IP address which entry points to. <host> value is without domain part e.g. ftp instead ftp.example.com. |
| satan dns add cname <domain> <host> <destination> | Add a CNAME record to the <domain>. The <host> as above can have 2 special values. Last argument points to destination domain, e.g. my.example.com. |
| satan dns add mx[<priority>] <domain> <host> <destination> | Add a MX record to the <domain>. The <priority> is optional and means a priority for MX entry. Priorities for multiple MX records can be equal then MX records are returned in round-robin fashion. |
| satan dns add txt <domain> <host> “<value>” | Add a TXT record to the <domain>. Can be used to set an SPF record. The <value> must be enclosed in double-quotes ("). |
| satan dns add srv <domain> <_service._protocol> “<priority> <weight> <port> <destination>.” | Add a SRV records to the <domain>. The <destination> must be canonical name but it cannot be a CNAME record. Remember about double-quotes (") and dot (.) at the end. |
| satan dns list | List all the DNS zones. It is convenient to pipe this command with less -r. |
| satan dns list <domain> | List DNS records for certain <domain>. |
Name servers¶
In order to allow Rootnode manage your domain you need to configure name servers in your domain provider. Our name servers are:
- ns1.rootnode.net
- ns2.rootnode.net
To check if name servers are configured properly use dig:
$ dig +short bongo.pl NS
ns1.rootnode.net
ns2.rootnode.net
If you see different entries that means that your domain wasn’t refreshed yet or you didn’t set it correctly.
DNS wildcard¶
You can create *.example.com wildcard with following command:
satan dns add cname example.com + example.com
Now, all requests for the domain example.com and its subdomains like ftp.example.com will return IP address set for example.com. Wildcard can coexist with a normal DNS record like the A record and both will work just fine.
Examples¶
Adding domain¶
We will add example.com domain and create few basic records for the domain:
$ satan domain add example.com
$ satan domain enable dns example.com
$ satan dns list
example.com
Id Record Type Resource
14920 @ soa internal
14921 @ ns ns1.rootnode.net
14922 @ ns ns2.rootnode.net
Adding A and CNAME¶
At this point we have our domain added to the system and tree records created: SOA and two NS records. Now we can add an A and a CNAME record:
$ satan dns add a example.com ^ 89.248.171.134
$ satan dns add cname example.com + example.com
See also Web server’s DNS configuration.
Listing zones¶
The configuration looks like:
$ satan dns list
example.com
Id Record Type Resource
14920 @ soa internal
14921 @ ns ns1.rootnode.net
14922 @ ns ns2.rootnode.net
14923 @ a 89.248.171.134
14924 * cname example.com
Checking domain¶
With dig command we can check if everything look good:
$ dig +short @ns1.rootnode.net test.example.com
89.248.171.134
That means our wildcard record works.
Web server’s DNS configuration¶
In most cases you would like to create an A record pointing the web server. You can do that with command:
$ satan dns add a example.com ^ <ip address of the web server>
As we have serveral web servers, relevant IP address you can find in a table below. To have also www.example.com domain working please create a DNS wildcard.
| Web server | IP address | Description |
|---|---|---|
| lyon.rootnode.net | 89.248.171.134 | Fastweb server for PHP applications and plain HTML pages. There is no .htaccess support. Extremely fast, very strong caching, memcache available. |
| wall.rootnode.net | 89.248.171.136 | Fastweb server for Python and Ruby applications based on NginX and Passenger. Memcache available. |
| venema.rootnode.net | 89.248.166.198 | THIS SERVER IS OBSOLETE! Please do not use it as we will migrate all pages soon. PHP applications, Subversion repositories and plain HTML pages goes here. Based on Apache2. |
Troubleshooting¶
Checking DNS¶
To check if records were added correctly you can ask Rootnode DNS servers with a dig tool. As an example we will ask for rootnode.net domain:
$ dig rootnode.net @ns1.rootnode.net ns
; <<>> DiG 9.7.2-P3 <<>> rootnode.net @ns1.rootnode.net ns
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37891
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 2
;; QUESTION SECTION:
;rootnode.net. IN NS
;; ANSWER SECTION:
rootnode.net. 300 IN NS ns1.rootnode.net.
rootnode.net. 300 IN NS ns2.rootnode.net.
;; ADDITIONAL SECTION:
ns1.rootnode.net. 300 IN A 89.248.171.131
ns2.rootnode.net. 300 IN A 188.165.195.68
;; Query time: 0 msec
;; SERVER: 89.248.171.131#53(89.248.171.131)
;; MSG SIZE rcvd: 98
As you can see from ANSWER SECTION, NS servers are configured properly for this domain.
Site doesn’t work¶
One of the most common problem is incorrectly configured DNS. Check an A record with the following domain:
$ dig example.com @ns1.rootnode.net A
; <<>> DiG 9.3.4-P1.1 <<>> example.com @ns1.rootnode.net A
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21696
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;example.com. IN A
;; ANSWER SECTION:
example.com. 300 IN A 89.248.171.134
;; Query time: 9 msec
;; SERVER: 89.248.166.199#53(89.248.166.199)
;; WHEN: Sun Jan 9 01:01:20 2011
;; MSG SIZE rcvd: 46
It looks good because our domain points a web server. Now we can check if the domain www.example.com points to example.com with a CNAME record. Additionaly we will use +short argument to shorten dig answer:
$ dig +short www.example.com @ns1.rootnode.net CNAME
example.com.
This is how the proper answer should look like.