Rapid Installation of a DNS Server
From Codawiki
[This is not necessary, unless you are in a situation like when you insist on calling your test realm MYCOMPANY.COM without your management's approval to put the record in the company's DNS (!) and you are ready to tweak all the realm clients for this purpose. Don't. Call your realm MYREALM.SOME.FREE.DNS.SERVICE.ORG and you are done. Locally run DNS servers is a no-solution for Coda unless you really manage a DNS zone, which is out of scope of this page]
Otherwise, there are small, simple and file-based DNS servers you can install and be running in no time.
One such is MaraDNS (http://www.maradns.org/). The best thing you can do is install it from distribution packages, and then configure using the sample config here.
Make sure that you pay attention to the dots (.) which appear after "EXAMPLE.COM" in some places, and the letter "A" that appears in askmara command; those are NOT mistakes, and should be typed-in verbatim as you see them!
Assuming that /etc/maradns/ is where your MaraDNS keeps the files, here's what you put in file /etc/maradns/mararc on your DNS server (which may be the same as Coda server):
ipv4_bind_addresses = "DNS_SERVER_IP, 127.0.0.1"
chroot_dir = "/etc/maradns"
recursive_acl = "LOCAL_NET/24"
csv2 = {}
csv2["EXAMPLE.COM."] = "db.EXAMPLE.COM"
And in file /etc/maradns/db.EXAMPLE.COM, you put simply:
CODA_SERVER.EXAMPLE.COM. A CODA_SERVER_IP _codasrv._udp.EXAMPLE.COM. SRV 0 0 2432 CODA_SERVER.EXAMPLE.COM. _codaauth2._udp.EXAMPLE.COM. SRV 0 0 370 CODA_SERVER.EXAMPLE.COM.
(Of course, you see which values to tune to your actual setup. If not, read below for help).
And that's all. Remember to re-start MaraDNS. Then add nameserver DNS_SERVER_IP to the top of your /etc/resolv.conf file on every system you want to use this DNS (including the Coda server itself). If you are using DHCP, you can pass nameserver information to the clients automatically (along with their other network details), but this is out of the scope of this quickstart guide.
Restart venus and give clog a few shots to realize there's a DNS now available. Fancy, ay!
Follow-up Configuration Help
In case you had trouble replacing placeholder values in the examples above with your actual settings, here's some more help:
DNS_SERVER_IP : Network IP address of the host where you installed MaraDNS server.
This can perfectly well be the same machine on which you install Coda server.
Example: 192.168.7.3
LOCAL_NET/24 : Network number in CIDR notation. If you use 192.168.y.x style IP addresses,
then your setting is 192.168.y.0/24. If you use 10.x.x.x style, then
use 10.0.0.0/8. (And read up more on CIDR notation).
Example: 192.168.7.0/24
EXAMPLE.COM : Your domain (or realm) name. Example: example.com ;-)
CODA_SERVER : Network hostname of your Coda server. (i.e. output of the "hostname" command on the server).
Make sure this is just the hostname, and not FQDN which includes the domain.
Example: codaserver1
CODA_SERVER_IP : Network IP address of your Coda server. This is the network address that you see
in the first line of output when you invoke command: ping -c 1 `hostname` .
In a small network, the DNS and the Coda server could happen to be the same machine, so the
DNS_SERVER_IP and CODA_SERVER_IP would be the same.
Example: 192.168.7.3
** NOTE **: Make absolutely sure that you don't see any address or names starting with "127." or "localhost"
anywhere in this setup (such as "127.0.0.1"). You must use network (and not localhost!) names and addresses.
** NOTE 2 **: If you have multiple Coda servers, just add more SRV lines to the ''db.EXAMPLE.COM'' file and
restart MaraDNS. Pay attention that there are two different service records in there, one for the Coda servers
themselves, and one for Coda Auth2 servers. Also, any additional hostnames must also have an "A" record, just
as the CODA_SERVER has.
Testing MaraDNS Setup
First of all, if you are getting errors when starting MaraDNS, it probably means you are using too old version. It should be 1.2.x.
If you want to make sure the things are correct on the MaraDNS side, after restarting MaraDNS, use the askmara command to check things from the shell:
askmara 33:_codasrv._udp.EXAMPLE.COM. # Querying the server with the IP 127.0.0.1 # Question: U_codasrv._udp.EXAMPLE.COM. _codasrv._udp.EXAMPLE.COM. +86400 raw 33 \x00\x00\x00\x00\x09\x80\x07'CODA_SERVER'\x04'EXAMPLE'\x02'COM'\x00 # NS replies: # AR replies: ---------------------------------- askmara 33:_codaauth2._udp.EXAMPLE.COM. # Querying the server with the IP 127.0.0.1 # Question: U_codaauth2._udp.EXAMPLE_COM. _codaauth2._udp.EXAMPLE.COM. +86400 raw 33 \x00\x00\x00\x00\x01'r'\x07'CODA_SERVER'\x04'EXAMPLE'\x02'COM'\x00 # NS replies: # AR replies: ---------------------------------- askmara ACODA_SERVER.EXAMPLE.COM. # Querying the server with the IP 127.0.0.1 # Question: ACODA_SERVER.EXAMPLE.COM. CODA_SERVER.EXAMPLE.COM. +86400 a CODA_SERVER_IP # NS replies: #EXAMPLE.COM. +86400 ns synth-ip-c0a80703.EXAMPLE.COM. # AR replies: #synth-ip-c0a80703.EXAMPLE.COM. +86400 a CODA_SERVER_IP
Automated MaraDNS Configuration
If you want to automatically perform the configuration (well, as automatically as it gets on this level), without copy/pasting and text replacement, download and run Davor Ocelic's vice-setup-maradns (http://www.hcoop.net/~docelic/vice-setup-maradns) script:
cd /tmp wget http://www.hcoop.net/~docelic/vice-setup-maradns sudo perl vice-setup-maradns --domain EXAMPLE.COM
