250 likes | 378 Vues
Introduction to DNS. The need for Hostnames. The Internet uses a four octet addressing scheme (IP Address) IP address contains information used for routing. The problem with IP address is that they are not user friendly. Manually mapping domain names.
E N D
The need for Hostnames • The Internet uses a four octet addressing scheme (IP Address) • IP address contains information used for routing. • The problem with IP address is that they are not user friendly.
Manually mapping domain names • Host names can be entered into the /etc/hosts file. • Sample hosts file • 207.245.216.100 homer.rcc.on.ca homer • 127.0.0.1 localhost • 10.10.0.8 as400.rcc.on.ca as400
Limitations of the hosts file • You can not possible put the entire Internet into the hosts file. • Anytime there is a change the whole file must be updated.
The Domain Name Service • The domain name service is used to translate a FQDN (Fully qualified domain name) into an IP address . • Domain names comprise a hierarchy so that names are unique, yet easy to remember.
DNS Hierarchy edu com org ca yahoo on msn nf unc rcc
Host name 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: • www.whitehouse.gov • Bobo.the.monkey.com • ross.homer.rcc.on.ca
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 sub-tree of the worldwide naming tree.This is referred to as the DMZ (Demarcation zone)
Top level domains • edu, gov, com, net, org, mil, … • Countries each have a top level domain (2 letter domain name). • New top level domains include: .aero .biz .coop .info .name .pro
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 RCC is responsible for everything within the rcc.on.ca domain.
DNS Distributed Database • There is one primary server for a domain, and typically a number of secondary servers containing replicated databases. RCC DNS server rcc.on.ca DNS DB rpi.edu DNS DB rcc.on.ca DNS DB rpi.edu DNS DB Authoritative Replicas
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 students.rcc.on.ca nameserver 10.10.0.5 Nameserver 205.189.197.162
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.
Special types of DNS records • DNS databases contain more than just hostname-to-address records: • Name server records NS • Hostname A • aliases CNAME • Mail Exchangers MX
DNS name servers Why not centralize DNS? single point of failure traffic volume distant centralized database maintenance no server has all name-to-IP address mappings local name servers: • each ISP, company has a local (default) name server • host DNS query first goes to local name server. • The local DNS is then responsible for servicing the request.
The root level servers • There are 14 root level servers • A.ROOT-SERVERS.NET. 198.41.0.4 • B.ROOT-SERVERS.NET. 128.9.0.107 • C.ROOT-SERVERS.NET. 192.33.4.12 • D.ROOT-SERVERS.NET. 128.8.10.90 • E.ROOT-SERVERS.NET. 192.203.230.10 • F.ROOT-SERVERS.NET. 192.5.5.241 • G.ROOT-SERVERS.NET. 192.112.36.4 • H.ROOT-SERVERS.NET. 128.63.2.53 • I.ROOT-SERVERS.NET. 192.36.148.17 • J.ROOT-SERVERS.NET. 198.41.0.10 • K.ROOT-SERVERS.NET. 193.0.14.129 • L.ROOT-SERVERS.NET. 198.32.64.12 • M.ROOT-SERVERS.NET. 202.12.27.33
The Root DNS Servers • The root server needs to know the address of the 1st and many 2nd level domain name servers. edu com org ca yahoo on msn nf unc
Simple DNS example local name server dns.rogers.com root name server Host someone.rogers.com wants IP address of rcc.on.ca 2 4 1. Contacts its local DNS server, dns.rogers.com 2.dns.rogers.com contacts root name server, if necessary 3. root name server contacts authoritative name server, dns.on.ca, if necessary 3 5 authorititive name server dns.ca 1 6 requesting host Someone.rogers.com rcc.on.ca
DNS example local name server dns.rogers.com intermediate name server dns.ca root name server 6 2 3 7 Root name server: • may not know authoritative name server • may know intermediate name server: who to contact to find authoritative name server 5 4 1 8 authoritative name server dns.on.ca requesting host Someone.rogers.com rcc.on.ca
DNS: iterated queries local name server dns.rogers.com intermediate name server dns.on.ca root name server iterated query 2 3 recursive query: • puts burden of name resolution on contacted name server • heavy load? iterated query: • contacted server replies with name of server to contact • “I don’t know this name, but ask this server” 4 7 5 6 1 8 authoritative name server dns.rcc.on.ca requesting host Someone.rogers.com homer.rcc.on.ca
DNS: caching and updating records • once (any) name server learns of a mapping, it will cache it for a period of time (TTL) • cache entries timeout (disappear) after some time • update/notify mechanisms under design by IETF (The Internet Engineering Task Force) • RFC 2136 • http://www.ietf.org/html.charters/dnsind-charter.html
nslookup • nslookup is an interactive resolver that allows the user to communicate directly with a DNS server. • nslookup is usually available on Unix workstations.