17 - All About DNS - Talking about DNS - What is the point? - turns Domain names into IP addresses - Common analogy: phonebook - not exactly right - DNS is heirarchical - Top Level Domains, TLD - com - org - gov - edu - biz - net - countries can have them too - ie - us - uk - tv - *Connor's Note* .tv belongs to Tuvalu - me - au - nz - de - under these are subdomains, which we think of as the domains - google.com - apple.com - typicalmacuser.com - impodcast.tv - iss-foundation.org - connorp.me - bartb.ie - and an infinite number of subdomains under these - Who decides these and has authority over a section of DNS? - Root Domain name servers - most important servers on the internet - tell who has authority over the TLDs - the TLDs then give authority to the subdomains - ad infinitum - DNS is a bunch of records - four important types - NS Record - Nameservers - who has authority over the DNS for a URL - A Record - maps a name to an IP address - www.typicalmacuser.com to an IP address - MX Record - Mail Exchange - which mailserver is responsible for email to @aurl.com - CNAME - alias - Finding an IP address for a URL via DNS is a multistep process - first your machine goes to the root servers and asks for the TLD for the URL - then it asks the TLD for the NS Record of the URL - then it asks the Nameserver and asks for the IP address - This would put a large amount of strain on the servers if this happened each time - to fix this, DNS servers, your machine, and even routers cache this information - how long this is kept is based upon a Time to Live, or TTL, set by the DNS record. - This is why when you change DNS it takes time for the change to propogate thru the entire world - host command, while simple, is very powerful - host www.typicalmacuser.com - output: - www.typicalmacuser.com is an alias for typicalmacuser.com. typicalmacuser.com has address 68.178.254.63 typicalmacuser.com mail is handled by 0 smtp.secureserver.net. typicalmacuser.com mail is handled by 10 mailstore1.secureserver.net. - 1st line is a CNAME - 2nd Line is an A record - 3rd and 4th lines are MX records - Another simple command, but very detailed output - asks a specific DNS server for the answer - dig - dig adomainname.com - dig www.bartb.ie - output: - ; <<>> DiG 9.4.3-P1 <<>> www.bartb.ie ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53330 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;www.bartb.ie . IN A ;; ANSWER SECTION: www.bartb.ie . 14400 IN A 70.38.18.241 ;; Query time: 266 msec ;; SERVER: 10.0.1.1#53(10.0.1.1) ;; WHEN: Sat Jun 27 21:25:54 2009 ;; MSG SIZE rcvd: 46 - first chunk: information on dig command - second chunk: the question you asked - third chunk: the answer - fourth chunk: some stats about the connection and request - Find the MX record - dig bartb.ie MX - Or the nameserver - dig bartb.ie NS - Now to ask the actual Nameserver - dig url.com@dnsserver - dig "ns1.panelboxmanager.com " - Bart Busschots - bartb.ie - impodcast.tv - podfeet.com