host name resolution. overview name resolution name resolution addressing a host addressing a host...
TRANSCRIPT
Host Name ResolutionHost Name Resolution
OverviewOverview
Name resolutionName resolution Addressing a hostAddressing a host
Host namesHost names Host name resolutionHost name resolution HOSTS fileHOSTS file DNSDNS DNS Name spaceDNS Name space ZonesZones
Registering a domainRegistering a domain DemoDemo
Name ResolutionName Resolution
TCP/IP can only address another host via TCP/IP can only address another host via it’s IP addressit’s IP address
IP addresses are difficult for humans to IP addresses are difficult for humans to remember remember 128.187.60.28128.187.60.28
Names are easy to remember Names are easy to remember www.isysguy.comwww.isysguy.com
Need for a way to map Names to IP Need for a way to map Names to IP addressesaddresses
Addressing a HostAddressing a Host
UNIXUNIX IP addressIP addressHost nameHost nameDomainDomain
WindowsWindows IP addressIP addressHost namesHost namesDomain NamesDomain NamesNetBIOS NamesNetBIOS Names
Host NamesHost Names
A host name is a friendly name used to A host name is a friendly name used to identify a computer so users don’t have to identify a computer so users don’t have to remember IP addressesremember IP addresses
There is not a 1 to 1 correlation between There is not a 1 to 1 correlation between host names and IP addresseshost names and IP addresses
Entries are stored in the Hosts File or DNS Entries are stored in the Hosts File or DNS (more on DNS later)(more on DNS later)
Use Use hostnamehostname utility to view utility to view
Host Name ResolutionHost Name Resolution
Process of mapping a host name to an IP Process of mapping a host name to an IP addressaddress
Standard methodsStandard methods Local host nameLocal host name ““hosts” filehosts” file Domain Name System (DNS)Domain Name System (DNS)
Microsoft SpecificMicrosoft Specific NetBIOS name serverNetBIOS name server Local broadcastLocal broadcast LMHOSTS fileLMHOSTS file
Resolving names with the HOSTS FileResolving names with the HOSTS File
Host B pings host AHost B pings host A B> ping AB> ping A
Host B checks its own host name to see if it is Host B checks its own host name to see if it is “A”“A”
If not, the HOSTS file is parsed looking for an If not, the HOSTS file is parsed looking for an entry for “A”entry for “A”
If no entry is found other methods are used such If no entry is found other methods are used such as Domain Name System (DNS)as Domain Name System (DNS)
If the host name is not resolved an error is If the host name is not resolved an error is returnedreturned
Hosts FileHosts FileC:\windows\system32\drivers\etc\hostsC:\windows\system32\drivers\etc\hosts
# Copyright (c) 1993-1999 Microsoft Corp.## This is a sample HOSTS file used by Microsoft TCP/IP for Windows.## This file contains the mappings of IP addresses to host names. Each# entry should be kept on an individual line. The IP address should# be placed in the first column followed by the corresponding host name.# The IP address and the host name should be separated by at least one# space.## Additionally, comments (such as these) may be inserted on individual# lines or following the machine name denoted by a '#' symbol.## For example:## 102.54.94.97 rhino.acme.com # source server# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
Microsoft Methods of Resolving Microsoft Methods of Resolving Host NamesHost Names
1.1. Local host nameLocal host name
2.2. HOSTS fileHOSTS file
3.3. DNSDNS
4.4. NetBIOS name server (WINS)NetBIOS name server (WINS)
5.5. BroadcastBroadcast
6.6. LMHOSTS fileLMHOSTS file
Domain Name System (DNS)Domain Name System (DNS)
A DNS server is a host that maintains a A DNS server is a host that maintains a database of Fully Qualified Domain database of Fully Qualified Domain Names(FQDN). The DNS server resolves Names(FQDN). The DNS server resolves FQDNs to IP addressesFQDNs to IP addresses
If configured, a DNS server is queried to If configured, a DNS server is queried to resolve host names not resolved via the resolve host names not resolved via the HOSTS fileHOSTS file
If the primary DNS server is not available If the primary DNS server is not available the next DNS server in the list is triedthe next DNS server in the list is tried
Domain Name SystemDomain Name System
In the beginning, all host names were stored in a In the beginning, all host names were stored in a master file master file hosts.txthosts.txt at Stanford Research at Stanford Research Institute’s Network Information CenterInstitute’s Network Information Center
All hosts on ARPANET would periodically copy All hosts on ARPANET would periodically copy the hosts.txt file to their local machinethe hosts.txt file to their local machine
After a while this became a bottleneck on the After a while this became a bottleneck on the networknetwork
Hosts file is a flat name spaceHosts file is a flat name space Problem was solved by introduction of DNS Problem was solved by introduction of DNS
(RFCs 1034, 1035 & 1591)(RFCs 1034, 1035 & 1591)
How DNS worksHow DNS worksThe Domain Name System is The Domain Name System is
implemented as a implemented as a client-server client-server hierarchical distributed databasehierarchical distributed database
DNS has two main componentsDNS has two main componentsThe ResolverThe ResolverThe DNS ServerThe DNS Server
ResolversResolvers
The DNS client is called a resolverThe DNS client is called a resolverResponsible to formulate queries for the Responsible to formulate queries for the
name servers to resolve a FQDN to an IP name servers to resolve a FQDN to an IP addressaddress
Often implemented as a standard library Often implemented as a standard library on systemon systemUnix gethostbyname()Unix gethostbyname()
Can be called by any application e.g. your Can be called by any application e.g. your web browserweb browser
Windows XP DNS ResolverWindows XP DNS Resolver Windows XP allows multiple DNS servers to be specified. The first Windows XP allows multiple DNS servers to be specified. The first
sever is the preferred sever.sever is the preferred sever.1.1. Check local cache.Check local cache.2.2. IF not in cache, first server Queried and waits 1 second IF not in cache, first server Queried and waits 1 second 3.3. If no response The first listed DNS server on each adapter is queried. If no response The first listed DNS server on each adapter is queried.
The resolver waits The resolver waits 22 seconds for a response. seconds for a response. 4.4. If no response the resolver sends the query to all DNS servers on all If no response the resolver sends the query to all DNS servers on all
adapters and waits another adapters and waits another 22 seconds. seconds. 5.5. If no response the query is sent on all adapters and waits If no response the query is sent on all adapters and waits 44 seconds seconds6.6. If no response the query is sent on all adapters and waits If no response the query is sent on all adapters and waits 88 seconds seconds7.7. If the resolver receives a positive response it adds the response to the If the resolver receives a positive response it adds the response to the
local cache and terminates all remaining queries.local cache and terminates all remaining queries.8.8. If no response, the resolver responds to the requesting application with If no response, the resolver responds to the requesting application with
a time-out.a time-out. If a server is not heard from within If a server is not heard from within 3030 seconds that server is seconds that server is
removed from the list of active servers.removed from the list of active servers.
DNS Resolver Cache ServiceDNS Resolver Cache ServiceWindow has a Window has a DNS resolver cache service DNS resolver cache service
that caches DNS queries to speed further that caches DNS queries to speed further DNS queriesDNS queries
Caches positive and negative responsesCaches positive and negative responsesTimeouts are configurableTimeouts are configurableDefault Negative cache timeout is 300 Default Negative cache timeout is 300
secondssecondsDefault Network Failure Cache timeout is Default Network Failure Cache timeout is
30 seconds30 seconds
Windows XP DNS commandsWindows XP DNS commands
ipconfig /flushdnsipconfig /flushdnsClears local DNS cacheClears local DNS cache
ipconfig /displaydnsipconfig /displaydnsShows local DNS resolutions in cacheShows local DNS resolutions in cache
ipconfig /registerdnsipconfig /registerdnsForces adapters to re-register their hostname Forces adapters to re-register their hostname
and IP address(es) with their name server. and IP address(es) with their name server. Only useful if DNS supports dynamic updatesOnly useful if DNS supports dynamic updates
Domain Name System ServerDomain Name System Server
Name serversName servers Responsible for maintaining lists of host names and Responsible for maintaining lists of host names and
IP addresses for resolutionIP addresses for resolution Each server only maintains a small portion of the DNS Each server only maintains a small portion of the DNS
name spacename space Name servers may either resolve the query or forward Name servers may either resolve the query or forward
the query to another serverthe query to another server ImplementationsImplementations
Berkley Internet Name Daemon (BIND)Berkley Internet Name Daemon (BIND) Microsoft DNS serverMicrosoft DNS server othersothers
Name SpaceName Space
.
eduorg
byuebayisysguy
us com
Root level domain
Top Level Domains
lindstrom
FQDN www.isysguy.com.
www
ZonesZones
A DNS zone is a portion of the DNS A DNS zone is a portion of the DNS database. database.
A zone is typically everything at the A zone is typically everything at the second level and belowsecond level and below
Zone of authority. The area of the DNS Zone of authority. The area of the DNS database that an organization is database that an organization is responsible for maintaining.responsible for maintaining.
Zone of Zone of AuthorityAuthority
.
com
Root level domain
students
craig
isysguy
www
Zone of Authority
Types of name serversTypes of name servers
PrimaryPrimary Keeps the authoritive copy of the DNS database for Keeps the authoritive copy of the DNS database for
its zone of authorityits zone of authority SecondarySecondary
Keeps a redundant copy of a zoneKeeps a redundant copy of a zone MasterMaster
Source of zone information for SecondariesSource of zone information for Secondaries CachingCaching
Perform queries only. Do not contain zone Perform queries only. Do not contain zone information other than cached resolutionsinformation other than cached resolutions
Name ResolutionName Resolution
Your ISPsName Server . (root)
Name Server
Edu.Name Server
byu.edu.Name Sever
DNS Client
RecursiveQuery
IterativeQueries
11
2233
44
5566
7788
www.byu.edu.
Record TypesRecord Types
Full list of record types Full list of record types http://www.iana.org/assignments/dns-parametershttp://www.iana.org/assignments/dns-parameters
Type Meaning Contents
A Host Address 32-bit IP address
CNAME Canonical Name Canonical Domain Name for an alias
HINFO CPU & OS Name of CPU and Operating System
MINFO Mailbox info Information about a mailbox or mail list
MX Mail Exchanger 16-bit preference and name of host that acts as mail exchanger for the domain
NS Name Server Name of authoritative server for domain
PTR Pointer Pointer from IP address to domain name
SOA Start of Authority Multiple fields that specify which parts of the naming hierarchy a server implements
TXT Arbitrary Text Uninterrupted string of ASCII text
Zone FilesZone Files; Database file isysguy.com.dns for isysguy.com zone.; Zone version: 222@ IN SOA ns2.drycreek.us.
register.isysguy.com. ( 222 ; serial number 300 ; refresh 120 ; retry 600 ; expire 300 ) ; default TTL; Zone NS records@ NS ns2.drycreek.us.ns2.drycreek.us. 3600 A 128.187.60.28@ NS ns1.drycreek.us.; Zone records@ 3600 A 128.187.60.28@ MX 10 mail.isysguy.com.bigo A 128.187.60.18craig 3600 A 128.187.60.25ftp CNAME www.isysguy.com.ilh 3600 A 128.187.60.25lab CNAME www.isyslab.com.mail 3600 A 128.187.60.28msdnaa A 128.187.60.110portal A 128.187.60.24www 3600 A 128.187.60.28
Root HintsRoot Hints The ICANN (Internet Corporation for Assigned Names The ICANN (Internet Corporation for Assigned Names
and Numbers) maintains and organizes the assignment and Numbers) maintains and organizes the assignment of domain names and certifies domain registrarsof domain names and certifies domain registrars ICANN is a private not for profit organization that maintains the ICANN is a private not for profit organization that maintains the
internet names and number systems.internet names and number systems. The registrars are responsible for maintaining the DNS The registrars are responsible for maintaining the DNS
root name serversroot name servers Every RFC compliant implementation of DNS must Every RFC compliant implementation of DNS must
include a root-hints cache fileinclude a root-hints cache file Contains a list of root name serversContains a list of root name servers Can be found at Can be found at ftp://rs.internic.net/domain/named.cacheftp://rs.internic.net/domain/named.cache
Each DNS server can find any FQDN by starting at the Each DNS server can find any FQDN by starting at the root servers and querying the DNS for a resolution. The root servers and querying the DNS for a resolution. The root servers will refer to the appropriate name servers.root servers will refer to the appropriate name servers.
Testing with NSLookupTesting with NSLookup
NSLookup is a utility that queries a name NSLookup is a utility that queries a name server for name resolutionsserver for name resolutions
nslookup FQDNnslookup FQDNLooks up the IP address for FQDNLooks up the IP address for FQDN
nslookupnslookup Interactive mode for multiple queriesInteractive mode for multiple queriesexitexit to quit to quit?? For commands For commands
TroubleshootingTroubleshooting
For DNS to work there must be a path For DNS to work there must be a path from the root servers to the lowest level from the root servers to the lowest level domain.domain.
A good resource to troubleshoot DNS A good resource to troubleshoot DNS problems is problems is http://www.squish.net/dnscheck/http://www.squish.net/dnscheck/ Performs full traversal of DNS servers for Performs full traversal of DNS servers for
target nametarget name
Registering a DomainRegistering a Domain
All domains are controlled by a domain All domains are controlled by a domain registration authority.registration authority.
Initially all .com, .edu, and .org domains were Initially all .com, .edu, and .org domains were administered by Network Solutionsadministered by Network Solutions
Now there are many other authorized domain Now there are many other authorized domain registrars such as godaddy.comregistrars such as godaddy.com
When you register a domain you become When you register a domain you become authoritive for that zoneauthoritive for that zone
Two DNS severs are required to register a Two DNS severs are required to register a domaindomain
Dynamic DNSDynamic DNS
Most DNS records are statically mappedMost DNS records are statically mappedDynamic IP addresses cause Dynamic IP addresses cause
inconsistencies in DNS databasesinconsistencies in DNS databasesDynamic DNS allows hosts to update their Dynamic DNS allows hosts to update their
own host record in the DNSown host record in the DNSMS DNS allows dynamic updates for MS MS DNS allows dynamic updates for MS
clientsclientshttp://www.dyndns.org/http://www.dyndns.org/ DNS that allows DNS that allows
dynamic updatesdynamic updates
Installing and Administering a Installing and Administering a Microsoft DNSMicrosoft DNS
Install from Add-Remove SoftwareInstall from Add-Remove SoftwareManage with management consoleManage with management consoleDemoDemo