cisco networking academy chabot college elec 99.08 name resolution

30
CISCO NETWORKING ACADEMY CISCO NETWORKING ACADEMY Chabot College Chabot College ELEC 99.08 ELEC 99.08 Name Resolution

Upload: bertram-morrison

Post on 23-Dec-2015

226 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Chabot CollegeChabot College

ELEC 99.08ELEC 99.08 Name Resolution

Page 2: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Name Resolution TopicsName Resolution Topics• Concepts

– name to IP address mapping– “fully qualified” domain names

• Methods– host tables– domain name services (DNS)

• Commands– ip host– ip domain-lookup– ip name-server– ip domain-name– show hosts

Page 3: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Name Resolution PurposesName Resolution Purposes1.Convenience of humans.

Which is easier to remember?• 198.133.219.25• www.cisco.com

Page 4: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Name Resolution PurposesName Resolution Purposes2.Ability to move machines with no disruption

of access.

What happens when we move a server to a different network or subnet? How do users find it?

198.133.219.25 becomes 209.42.167.99

butwww.cisco.com remains www.cisco.com

Page 5: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Fully Qualified Domain NameFully Qualified Domain Name• Unique in the world - no duplicates.• Example:library.stanford.edu

• Heirarchical structure:– Top level domain (e.g. edu)– Domain (e.g. stanford)– Host (e.g. library)

Page 6: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Fully Qualified Domain NameFully Qualified Domain Name

chabotde.clpccd.cc.ca.us

Host name Domain name Top-LevelDomain

Sub-Domains

Page 7: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Fully Qualified Domain NameFully Qualified Domain Name• For our labs, we’ll assume this domain

name has been assigned: lab.edu• Our router’s fully qualified domain names

will therefore be:– fremont.lab.edu– hayward.lab.edu– oakland.lab.edu

Page 8: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Default Domain NameDefault Domain Name• TCP/IP configurations include a default

domain to be appended to any unqualified hostname (e.g. hayward).

• For our labs, we’ll use this default domain: lab.edu

• Then when you ping fremont, TCP/IP will actually ping fremont.lab.edu

• Saves a lot of typing!

Page 9: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Resolving Names to AddressesResolving Names to Addresses• Host Tables• Domain Name Services

Page 10: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Host TableHost Table• Created manually on each router or computer• Maps names to IP addresses

– fremont.lab.edu 192.168.1.1– hayward.lab.edu 192.168.2.1

• Provides name resolution only on the host on which the table was created.

• Fast, low overhead, cached in RAM.

Page 11: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Host Table CommandsHost Table Commands• ip host [name] [address]• May include up to 8 addresses per name• Global config mode

oak(config)#ip host fremont 192.168.1.1 10.1.0.1oak(config)#ip host hayward 192.168.2.1 10.2.0.1oak(config)#ip host oakland 192.168.3.1 10.2.0.2

Page 12: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Domain Name Services (DNS)Domain Name Services (DNS)• A network service• Runs on one or two servers that are used by all hosts on the network• Maps names to IP addresses

– fremont.lab.edu 192.168.1.1– hayward.lab.edu 192.168.2.1

• Used throughout the global Internet

Page 13: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

DNS - Special ConsiderationsDNS - Special Considerations• Billions of IP addresses in use, many mapped to a name.

(We could never fit them in a hosts file.)• IP addresses and domain names change daily, and new ones are assigned daily.

(We could never keep hosts files up to date.)• DNS is like a global phone book that must be

– kept up-to-date– very fast in its response

Page 14: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

How DNS WorksHow DNS Works• Local host sends DNS query to the local name server defined in the host’s TCP/IP config. (UDP port 53)• If the local name server knows the address of the target name, it sends back a reply.• Otherwise, it forwards the query to one of the 13 root name servers on the Internet.• The root server then returns the IP address of the primary name server responsible for the domain being requested. • The local name server then begins a recursive process, contacting the primary name server and then the authoritative name server for the target domain.• The local name server then fills the local host’s request for the target ip address.• The host then uses the supplied IP address to contact its target.

Page 15: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

How DNS Works - ExampleHow DNS Works - Example• To find the IP address of technet.micrsoft.com...

• your PC asks the Chabot name server, which then performs the following steps:

• Asks one of the 13 root name servers on the Internet for the addresses of the com name servers

• Asks one of these com servers for the address of the microsoft.com name server

• Ask the microsoft.com name server for the address of the host: technet.microsoft.com.

• The chabot name server then replies to your PC with the target IP address

Page 16: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

How DNS WorksHow DNS Works

Page 17: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

DNS CommandsDNS Commands• no ip domain-lookup• Turns off the use of DNS to look up the ip address mapped to a hostname• Used in our practice lab to prevent delays due to mistyped commands• Global config mode

oak(config)#no ip domain-lookupoak(config)#

Page 18: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

DNS CommandsDNS Commands• ip domain-lookup• Turns on the use of DNS to look up the ip address mapped to a hostname• This is the default for all routers, so this command is only needed if lookup was previously turned

off with no ip domain-lookup• Global config mode

oak(config)#ip domain-lookupoak(config)#

Page 19: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

DNS CommandsDNS Commands• ip name-server xxx.xxx.xxx.xxx

• Sets the address for the DNS server to be used

• All DNS queries will go to this server

• Up to six server addresses may be listed, separated by spaces

• Global config mode

oak(config)#ip name-server 172.28.118.12oak(config)#

Page 20: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

DNS CommandsDNS Commands• ip domain-name [name]

• Sets the default domain to be appended to “unqualified” names

• Saves repetitive typing of local domain

• Global config mode

oak(config)#ip domain-name lab.eduoak(config)#

Page 21: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

DNS CommandsDNS Commands• Typical configuration• Global config mode

oak(config)#ip domain-lookup oak(config)#ip name-server 172.28.118.12oak(config)#ip domain-name lab.eduoak(config)#

• On a Windows PC, the same settings are made in the Network Control Panel, TCP/IP properties.

Page 22: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Show Hosts CommandsShow Hosts Commands• show hosts• Lists the host-address mappings cached in RAM• privileged EXEC mode

router#show hosts

Default domain is CISCO.COM Name/address lookup uses domain service Name servers are 192.31.7.10 131.108.4.12

Host Flag Age Type Address(es)SLAG.CISCO.COM (perm, OK) 1 IP 131.108.4.10CHAR.CISCO.COM (temp, OK) 8 IP 192.31.7.50CHAOS.CISCO.COM (temp, OK) 8 IP 131.108.1.115DIRT.CISCO.COM (temp, EX) 8 IP 131.108.1.111DUSTBIN.CISCO.COM (temp, EX) 0 IP 131.108.1.27DREGS.CISCO.COM (temp, EX) 24 IP 131.108.1.30

Page 23: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Show Hosts CommandsShow Hosts Commands• Flags:

– perm - address resolved by host table– temp - address resolved by DNS

router#show hosts

Default domain is CISCO.COM Name/address lookup uses domain service Name servers are 192.31.7.10 131.108.4.12

Host Flag Age Type Address(es)SLAG.CISCO.COM (perm, OK) 1 IP 131.108.4.10CHAR.CISCO.COM (temp, OK) 8 IP 192.31.7.50CHAOS.CISCO.COM (temp, OK) 8 IP 131.108.1.115DIRT.CISCO.COM (temp, OK) 8 IP 131.108.1.111DUSTBIN.CISCO.COM (temp, EX) 0 IP 131.108.1.27DREGS.CISCO.COM (temp, EX) 24 IP 131.108.1.30

Page 24: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

DNS Server RecordsDNS Server Records• A few DNS record types

– A (host address)– CNAME (alias - cannonical name)– PTR (domain name pointer - for reverse lookup)– MX (mail exchange - mail server for domain)

• CNAME records mean that a host at one IP address can have many names.

Page 25: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Let’s try it!Let’s try it!• Point your browser at:

http://www.clpccd.cc.ca.us

http://porter.clpccd.cc.ca.us• For the host at 209.129.156.3, Chabot’s DNS

servers list– porter as the host name (A-record)– www as a name alias (CNAME-record)

Page 26: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Let’s try it!Let’s try it!

• Point your browser at:http://porter

• On your PC, the default domain is set to– clpccd.cc.ca.us

• Therefore, when you browse to porter, you reach the ip address of porter.clpccd.cc.ca.us

Page 27: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Let’s try it!Let’s try it!

• At the DOS prompt:ping davis

• On your PC, the default domain is set to– clpccd.cc.ca.us

• Therefore, when you ping davis, you reach the ip address of davis.clpccd.cc.ca.us

Page 28: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Lookup SequenceLookup Sequence1. Check cache in RAM.

If entry not found,

2. Check hosts table. If entry not found,

3. Query local DNS server. If entry not found, refer to root server and then to authoritative DNS server for the target domain.

Therefore, host table entries will be used first to satisfy a query.

Page 29: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Site Blocking - a simple approach...Site Blocking - a simple approach...• What does this address mean?

127.0.0.1• “loopback” address - your own NIC

Page 30: CISCO NETWORKING ACADEMY Chabot College ELEC 99.08 Name Resolution

CISCO NETWORKING ACADEMYCISCO NETWORKING ACADEMY

Site Blocking - a simple approach...Site Blocking - a simple approach...• Suppose I wanted to prevent my browser from diplaying ads from ad1.doubleclick.net

which DNS resolves to 206.65.183.110.

• Where would my browser go if my PC’s host table contained this entry?127.0.0.1 ad1.doubleclick.net

• Take a look at this hosts file, which is designed to support ad blocking.• For more info, point your browswer athttp://www.accs-net.com/hosts/index.html