DNS

Done

It is a protocol that converts a given name to its respective IP Address. This is a feature that allows us humans to easily remember the address of a given service without relying on numbers, but machines only understand numbers. Therefore, the conversion is necessary.

DNS Server is the service that returns in response to a query, an IP Address for a given name. And a machine can learn its address by:

  • Manually configuring.
  • learning via DHCP.

💡
NOTE: The router can simply forward the DNS query, or it can act as a DNS Server or as a client, or even both.

There are types of DNS records, some of them are:

🚨
IMPORTANT: Normally DNS queries will be done via UDP, but if the message is longer than 512 bytes it will use TCP.

Configure DNS in Cisco IOS

Act as a server

configure terminal
ip dns server

Add DNS records

configure terminal
ip host {name} {ip-address}    //This can be issued multiple times

See the list of configured DNS Records (hosts)

show hosts

Acting as a client

This is important so the router can ask a DNS server in case it doesn`t have an internal record for that given name.

ip domain lookup   //In old version it was ip domain-lookup. This enables the ability to do DNS queries.

Select a DNS Server

ip name-server {ip-address}

Domain Name (optional)

This is used to append a name to a DNS query that has no domain name explicitly said.

ip domain name {name}   //Old versions would be ip domain-name {name}

For example, if I issue this command with bertini.com, if I do a ping PC1, the DNS query will actually be sent with pc1.bertini.com

Windows Commands

View the IP Address of a name

C\: nslookup {name}

View DNS Cache

C\: ipconfig /displaydns

Erase the DNS Cache

C\: ipconfig /flushdns