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.
There are types of DNS records, some of them are:
- “A” → Maps a name to an IPv4 address
- “AAAA” → Maps a name to an IPv6 address
- CNAME (Canonical Name) → Maps a name to another name
Configure DNS in Cisco IOS
Act as a server
configure terminal
ip dns serverAdd DNS records
configure terminal
ip host {name} {ip-address} //This can be issued multiple timesSee the list of configured DNS Records (hosts)
show hostsActing 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 /displaydnsErase the DNS Cache
C\: ipconfig /flushdns