1 / 65

Domain Name System (DNS)

AICTE SDP on Open Source Software, St. Peters Engineering College. Sept 13, 2007. Domain Name System (DNS). S Subathra Project Engineer, NRCFOSS AU-KBC Research Centre MIT Campus of Anna University Chennai – 600 044

acorrea
Download Presentation

Domain Name System (DNS)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. AICTE SDP on Open Source Software, St. Peters Engineering College. Sept 13, 2007 Domain Name System (DNS) S Subathra Project Engineer, NRCFOSS AU-KBC Research Centre MIT Campus of Anna University Chennai – 600 044 subathra@au-kbc.org

  2. Agenda • Introduction • DNS Overview • DNS Organisation • Types of DNS Resource Records • DNS Examples • Standards • Summary • Discussion & Questions Domain Name System

  3. Introduction Domain Name System

  4. Introduction • Computers (hosts, routers) connected to the Internet have two forms of names: • IP address — a 32 bit identifier used for addressing hosts and routing data to them • Hostname – an ASCII string used by applications • The DNS is an Internet-wide service that provides mappings between IP addresses and hostnames • The DNS is a distributed database implemented in a hierarchy of name servers • The DNS is also an application-layer protocol • Hosts and routers use name servers to resolve names (address/name translation) • Name resolution is an essential Internet function implemented as application-layer protocol Domain Name System

  5. Hostname structure • Each host name is made up of a sequence of labels separated by periods. • Each label can be up to 63 characters • The total name can be at most 255 characters. • Examples: • nrcfosshelpline.in • lan.au-kbc.org • nrcfoss.org.in Domain Name System

  6. IP Addresses • Format "A.B.C.D" where each letter is a byte • Class A network : A.0.0.0 • Zeroes are used to indicate that any number could be in that position • Class B network: A.B.0.0 • Class C network: A.B.C.0 • Broadcast addresses: • 255.255.255.255 • A.B.C.255 • Special case • 0.0.0.0 and A.B.C.0 can be either treated as a broadcast or discarded Domain Name System

  7. Other IP Addresses • Multicast (class D) • 224.0.0.0 to 239.255.255.255 • Class E (experimental, reserved, i.e., wasted) • 240.0.0.0 to 254.255.255.255 Domain Name System

  8. DNS Overview Domain Name System

  9. History • In 1983, Paul Mockapetris wrote the first implementation of DNS. • Original specifications appear in RFC 882 and 883. • In 1984, four Berkeley students — Douglas Terry, Mark Painter, David Riggle and Songnian Zhou — wrote the first UNIX implementation, which was maintained by Ralph Campbell thereafter. • In 1985, Kevin Dunlap of DEC significantly re-wrote the DNS implementation and renamed it BIND (Berkeley Internet Name Domain, previously: Berkeley Internet Name Daemon). Mike Karels, Phil Almquist and Paul Vixie have maintained BIND since then. • In 1987, the publication of RFC 1034 and RFC 1035 updated the DNS specification. Domain Name System

  10. The Domain Name System • Distributed Directory Service • Maps names to values – resource records • Major backbone of the internet • Makes networks human friendly Domain Name System

  11. Domain Name • The domain name for a host is the sequence of labels that lead from the host (leaf node in the naming tree) to the top of the worldwide naming tree. • A domain is a subtree of the worldwide naming tree. • Domain contains resource records that point to authoritative server for sub-domains / zones Domain Name System

  12. Top level domains • Generic domains: • .com ,.org ,.net ,.edu ,.gov ,.mil ,.int • .biz ,.info ,.name ,.pro • Special sponsored names • .aero ,.coop ,.museum • Country code domains (2 letter domain name). • .uk ,.de ,.jp ,.us ,.in Domain Name System

  13. DNS - Illustration “root” zone TLDs & ccTLDs 2lds 3lds 4lds Key: TLDs – Top Level Domains; ccTLDs – country code Top Level Domains Domain Name System

  14. DNS - Illustration “root” zone TLDs & ccTLDs 2lds “zone cuts” or delegation points 3lds 4lds Domain Name System

  15. Zone • Its records are held in a database (“zonefile”) and served from an authoritative name server • Zone refers to all the resource records in a domain but not its sub domains, the com.au zone contains delegations records for ausregistry.com.au, but not the resource records for ausregistry.com.au, however all of these records are part of the com.au domain Domain Name System

  16. Delegation • Delegation refers to the act of putting NS records in a domain name “delegating” control of a sub-domain to another entity • This entity then has the ability to control the resource records in this sub-domain and delegate further children domains to other entities. Domain Name System

  17. DNS vs File System Domain Name System

  18. Naming a Domain Naming a Directory yahoo.com.au. C:\windows\system32\drivers\ A “.” is used as separator A “\” is used as separator Domain Name System

  19. DNS Organisation Domain Name System

  20. DNS Organization • Distributed Database • The organization that owns a domain name is responsible for running a DNS server that can provide the mapping between hostnames within the domain to IP addresses. • So - some machine run by RPI is responsible for everything within the rpi.edu domain. Domain Name System

  21. DNS Distributed Database • There is one primary server for a domain, and typically a number of secondary servers containing replicated databases. rpi.edu DNS server rpi.edu DNS DB rpi.edu DNS DB Replicas Authoritative Domain Name System

  22. DNS Clients • A DNS client is called a resolver. • A call to gethostbyname()is handled by a resolver (typically part of the client). • Most Unix workstations have the file /etc/resolv.conf that contains the local domain and the addresses of DNS servers for that domain. • /etc/resolv.conf domain rpi.edu 128.113.1.5 128.113.1.3 Domain Name System

  23. nslookup • nslookup is an interactive resolver that allows the user to communicate directly with a DNS server. • nslookup is usually available on Unix workstations. (dig and host are also DNS clients). Domain Name System

  24. DNS Servers • Servers handle requests for their domain directly. • Servers handle requests for other domains by contacting remote DNS server(s). • Servers cache external mappings. Domain Name System

  25. Server - Server Communication • If a server is asked to provide the mapping for a host outside it’s domain (and the mapping is not in the server cache): • The server finds a nameserver for the target domain. • The server asks the nameserver to provide the host name to IP translation. • To find the right nameserver, use DNS! Domain Name System

  26. DNS Data • DNS databases contain more than just hostname-to-address records: • Name server records NS • Hostname aliases CNAME • Mail Exchangers MX • Host Information HINFO Domain Name System

  27. The Root DNS Server • The root server needs to know the address of 1st (and many 2nd) level domain nameservers. com edu org in rpi vit Domain Name System

  28. The Root DNS Server Operation • If a server has no clue about where to find the address for a hostname, ask the root server. • The root server will tell you what nameserver to contact. • A request may get forwarded a few times. Domain Name System

  29. Name Server Server responsible for answering DNS queries • Exists at all levels of hierarchy • Authoritative name servers hold part of the DNS database • One name server can serve more then one zone • Many name servers “should” serve the same zone • Some name servers are authoritative for certain zones Domain Name System

  30. Iterative vs Recursive Name Servers • Serve two very different functions • Shouldn’t mix the two • Generally the DNS points your computer to recursive • Zones are hosted in iterative name servers • Iterative servers can only answer information they know or have cached • Recursive know how to ask others for information Domain Name System

  31. DNS Message Format HEADER QUERIES Response RESOURCE RECORDS Response AUTHOURITY RECORDS Response ADDITIONAL INFORMATION Domain Name System

  32. DNS Message Header 16 bit fields query identifier flags # of questions # of RRs # of authority RRs # of additional RRs Response Domain Name System

  33. Message Flags • QR: Query=0, Response=1 • AA: Authoritative Answer • TC: response truncated (> 512 bytes) • RD: recursion desired • RA: recursion available • rcode: return code Domain Name System

  34. Question Format • Name: domain name (or IP address) • Query type (A, NS, MX, …) • Query class (1 for IP) Domain Name System

  35. Response Resource Record Field Description Length(Octets) NAME Name of the node to which this record pertains. (variable) Type of RR. For example, MX is type 15. 2 TYPE Class code. 2 CLASS 4 TTL Signed time in seconds that RR stays valid. RDLENGTH Length of RDATA field. 2 RDATA Additional RR-specific data. (variable) Table: RR (Resource Records) Fields Domain Name System

  36. Types of DNS Resource Records Domain Name System

  37. DNSResource Records • A domain contains resource records • Resource records are analogous to files • Classified into types • Some of the important types are NS, A, CNAME and MX • Normally defines in “zone files” • RR format: <name, value, type, time_to_live> Domain Name System

  38. DNS Resource Records • The DNS is a distributed database storing resource records (RRs) • Type = NS • name is a domain • value is name of authoritative name server for this domain • Type = A • name is a hostname • value is hostname’s IP address • Type = CNAME • name is an alias name for some “canonical” (the real) name • value is canonical name • Type = MX • value is name of mail server host associated with name Domain Name System

  39. The “A” Record • The “Address” record • One or more normally defines a host • Contains an IPv4 Address (the address computers use to uniquely identify each other on the internet) • Eg. The record: www A 203.18.56.31 In the ausregistry.com.au domain, defines the host uniquely identifiable as “www.ausregistry.com.au” to be reachable at the IPv4 Address 203.18.56.31 Domain Name System

  40. The “CNAME” Record • A CNAME defines an alias • The alias will then be resolved, if another CNAME is encountered then the process continues until an A record is found • Eg. The record: search CNAME www.google.com In the ausregistry.com.au domain, defines the name uniquely identifiable as “search.ausregistry.com.au” to be and alias to “www.google.com” Domain Name System

  41. The “MX” Record • An MX record defines the mail servers for a particular domain • Mail eXchange records hold the name of hosts, and their priorities, able to deliver mail for the domain. • Eg. The record: ausregistry.com.au MX 10 mail In the ausregistry.com.au domain, defines the host mail to be the priority 10 mail server for the “ausregistry.com.au” domain Domain Name System

  42. The “NS” Record • An NS record defines the authoritative Name servers for the domain. • The “Name Server” records also define the name servers of children domains • Eg. The record: internal NS ns1.hosting.com.au. In the ausregistry.com.au domain, defines the host “ns1.hosting.com.au” to be a name sever for the “internal.ausregistry.com.au” sub-domain Domain Name System

  43. DNS Examples Domain Name System

  44. Example 1: Accessing a web page • You type http://www.google.com into your web browser and hit enter. • What happens now? Domain Name System

  45. Step 1: Your PC sends a resolution request to its configured DNS Server, typically at your ISP. Tell me the Address of “www.google.com” Domain Name System

  46. Step 2: Your ISPs recursive name server starts by asking one of the root servers predefined in its “hints” file. Tell me the Address of “www.google.com” I don’t know the address but I know who’s authoritative for the ”com” domain ask them Domain Name System

  47. Step 3: Your ISPs recursive name server then asks one of the “com” name servers as directed. Tell me the Address of “www.google.com” I don’t know the address but I know who’s authoritative for the ”google.com” domain ask them Domain Name System

  48. Step 4: Your ISPs recursive name server then asks one of the “google.com” name servers as directed. Tell me the Address of “www.google.com” The Address of www.google.com is 216.239.53.99 Domain Name System

  49. Step 5: ISP DNS server then send the answer back to your PC. The DNS server will “remember” the answer for a period of time. The Address of www.google.com is 216.239.53.99 Domain Name System

  50. Step 6: Your PC can then make the actual HTTP request to the web server. Send me the www.google.com.au web page Here it is! Domain Name System

More Related