This is a “you learn better when you write it down” sort of post. Never actually got into DNS record types – as a lot of things I’ve missed, there was just no need and I wasn’t curious enough. Although curiosity without regular application of that knowledge is rather pointless – “you soon will forget the tune that you play”, if you play it just once or twice.
That said, I’m gonna be needing this knowledge soon (I presume), so I thought I better do me a hint page (a “crib sheet”, as the dictionary suggests).
- A record – “Address”, a connection of a name to an IP address like, for instance, “example.com. IN A 18.104.22.168” – where IN is for the Internet, i.e. “Internet Address…” Wildcards could be used for “all subdomains”
- AAAA – “four times the size”, A-address for IPV6 addresses (see a note on IPV6 below)
- CNAME – Canonical Name, specifies an alias for existing A record, like “subdomain.example.com CNAME example.com“. Useful to make sure you only have one IP address in A record, and others rely on A name – so if IP changes, it’s one place you have to change it at. Note: do not use CNAME aliases in MX records.
- MX – Mail eXchange, specifies which server serves zone’s mail exchange purposes – like, for instance, “mydomain.com IN MX 0 mydomain.com.“; final dot is important, 0 is for priority: ther could be multiple MX records for the zone, and they processed in priority order (the lower the number the higher the priority). Same-priority records are processes in random order. Right-side name should be an A record.
- PTR – specify pointer for a reverse DNS lookup, required to validate hostname identity in some cases – “22.214.171.124.in-addr.arpa. IN PTR name.net” (note that IP of name.net is 126.96.36.199)
- NS – Name Server, specifies a (list of) authoritative DNS server for the domain, for instance: “example.com. IN NS ns1.live.secure.com“. This should be specified at authoritative server as well.
- SOA – State Of Authority, an important record with zone’s name server details – “authoritative information about an Internet domain, the email of the domain administrator, the domain serial number, and several timers relating to refreshing the zone“. Example: mydomain.com. 14400 IN SOA ns.mynameserver.com. root.ns.mynameserver.com. (
2004123001 ; Serial number
86000 ; Refresh rate in seconds
7200 ; Update Retry in seconds
3600000 ; Expiry in seconds
600 ; minimum in seconds )
- SRV – an option to specify a server for a Service, like “_http._tcp.example.com. IN SRV 0 5 80 www.example.com.” – here’s the service name (_http), priority (0), weight (5) for services with the same priority, and port (80) for the service.
- NAPTR – recent and complex regexp-based name resolution I’m not keen to into.
- There’s MUCH MORE of this crap, hope I won’t need to ever dig that deep
- There’s also a number of decentralized DNS initiatives
Oh, and on IPV6:
- it’s 128-bit (IPV4 is 32)
- it’s recorded in hex numbers, 8 quads
- it has following structure:
2001:0db8:3c4d:0015:0000:0000:abcd:ef12 ______________|____|___________________ global prefix subnet Interface ID
- local address is 0000:0000:0000:0000:0000:0000:0000:0001
- and IPV4 record in that case would look like 0000:0000:0000:0000:0000:0000:192.168.1.25
- zeroes could be omitted: ::1 or ::192.168.1.25
- to make sure address is shortened correctly, use ipv6calc util: ipv6calc –in ipv6addr –out ipv6addr –printuncompressed ::1