Introduction to DNS

Hello if you creat your own DNS server on your router with the #ip host [name] [ip adress].

for example
#ip host [bob1] [20.0.0.1]

But if I type the command no ip domain-lookup im still able to type #ping bob1 and the ping works. The ip adress 20.0.0.1 is on a remote network.

I beleve that no ip domain-lookup turns off the ability for the router to look up and resolve domain names. But in this case it does not?

Why?

Regards Lars

Hello Lars

The ip host command is used to define static hostname to IP address mappings in the DNS hostname cache of the local device. This means that any time a domain name is used instead of an IP address, that mapping will be checked first, before any external DNS, if configured. This is kind of analogous to the ā€œhostsā€ file found in Windows systems.

By typing the command no ip domain-lookup, you are disabling the lookup on an external DNS server, however, you are not disabling the lookup in the statically defined mappings. According to the following Cisco documentation:

In order to use this service to map domain names to IP addresses, you must specify a name server.

So a prerequisite to the mappings functioning is that a name server be specified, even if the domain lookup is disabled.

I hope this has been helpful!

Laz

1 Like

Hi,
networklessons.com resolving to multiple ip address ?
Letā€™s say the server with the ip 52.204.90.56 is down , then how the client will chose the second ip address ?
Thanks

Hello Sims

A DNS record can point to multiple IP addresses for the same domain name. If you do an nslookup for various well-known DNS addresses, you will find some that return multiple IPv4 or IPv6 addresses. Even www.networklessons.com returns multiple IP addresses.

When a web browser, or any computer application, makes a request to www.networklessons.com, the host will try communication with the returned IP addresses one by one, until a response is received. This way, if one address fails, the next one in line will be attempted until successful.

I hope this has been helpful!

Laz

Hi,
Could you explain a bit about how DNS-SD works, please? Iā€™m guessing you need to configure the authoritative domain server to advertise services into the domain, but presumably the clients on the network will also need to know what services to ask for? I know I ought to build myself a DNS server to see exactly whatā€™s going on, but donā€™t quite know where to startā€¦ Would you still need a recursive resolver on the network to hand communicate directly with the client, which then in turn talks to the authoritative name server? The network I have in mind will not be connected to the outside world so doesnā€™t need to know how to get to anything else on the internet.
Regards, Hild

Hello Hild

DNS-SD is a way of using standard DNS programming interfaces, servers, and packet formats to browse the network for services. You can find detailed information about how it works and how it can be configured within a Cisco environment at the following documentation:

I hope this has been helpful!

Laz

Hi guys,

Can you explain what is a PTR record and what it is used for?

Thanks

Hello Giovanni

Put simply, a PTR record is the opposite of an A record. An A record is used to retrieve the IP address from a domain name. For example, when you put www.networklessons.com in your browser, a request is sent to your DNS server to obtain the IP address that corresponds with this domain. An A record is looked up in the DNS server for this purpose.

The Pointer Record or PTR, does the opposite. A host will request the domain name associated with a particular IP address. This is used in reverse DNS lookups. This actually requires a separate record in the DNS server. You canā€™t simply use an A record for reverse DNS lookups.

There are several uses for reverse DNS lookups and the PTR records they require. These include:

  • Network troubleshooting - this was the original purpose, where tools such as traceroute and ping, as well as some uses for SMTP email headers.
  • Email anti-spam technique - you can check the domain names using reverse DNS to see if they are from dynamically assigned IP addresses that are unlikely to use legitimate email servers.
  • Forward-confirmed reverse DNS (FCrDNS) verification - This is a form of authentication that verifies a valid relationship between the owner of a domain name and the owner of the server that has been given an IP address. This method is not very thorough, but it is strong enough to be used for whitelisting purposes, since spammers and phishers usually cannot achieve forward validation when they use zombie computers to forge domain records.
  • Some system logging and monitoring tools reference the devices they are monitoring using only an IP address. In order to display more human-readable information, using reverse DNS lookup can put the domain names in place of the IP addresses.

I hope this has been helpful!

Laz

I am struggling to fully understand how DNS request are handled and how the router selects the path/forwarders

Hello Ruben

Take a look at this lesson that talks about DNS in general and gives you an overview of its operation:

Concerning how routers choose the path to be taken, this is independent of the operation of DNS. This is done solely by the use of IP addressing. More on how routers make these decisions can be found in the following lessons:

If you require an answer to a more specific question, feel free to clarify and weā€™ll get back to you very soon!

I hope this has been helpful!

Laz

Whats VPS ?

vps.networklessons.com.
vps.networklessons.com

i tried entering these addresses on my web browser and they didnā€™t open / nothing happen

Hello Abdul

The address vps.networklessons.com belongs to a virtual private server used by the NetworkLessons website. It is not accessible to the general public, however, it was used in the lesson only for example purposes. It shows how a subdomain can be assigned.

I hope this has been helpful!

Laz

  1. What are the scenarios that a DNS reply will have the Authoritative server flag disabled (set to 0)?
    For example, if a DNS query is made to a domain abc.com, and if the dns response to the query is from a recursive resolver, is the value for the ā€œAuthoritativeā€ flag set to Zero? Please confirm.

  2. If my understanding is correct, the process for a dns resolution is something like:
    a. Client ( initiates a dns request)
    b. Recursive Resolver (local dns intercepts the query). if the cache has the dns domain name, then the resolver responds to client with the domain IP address and sets Authoritative flag to Zero.
    If not, it reaches to the root server.
    c. Root server (.) defers the query to TLD server.
    d. TLD server (containing common TLDā€™s such as .com/.net) receives the request and defers the query to the actual authoritative name server.
    e. Authoritative server responds with the IP address of the domain name if it has the information to the local resolver, which then caches this information before responding to the client.
    f. Finally, the client accesses the domain using the IP address from the info from itā€™s local dns resolver.

is my understanding correct?

Hello Adhithya

Yes, your understanding is correct. The ā€œAuthoritativeā€ flag in a DNS response is set to zero (disabled) when the response is from a non-authoritative source such as a cache or a recursive resolver. In your example, if a DNS query is made to a domain like abc.com and the response is from a recursive resolver, the authoritative flag would indeed be set to zero. This is because the recursive resolver is not the authoritative source for the domain in question, it merely forwards the request to the appropriate authoritative server and returns the response it receives. Even if the recursive resolver made the request to an authoritative server, andthe authoritative server responds with the flag set, when the recursive resolver relaysthat inforamation, it will typically set the flag to 0.

Your understanding of the DNS resolution process is essentially correct, but there are a few nuances worth noting. The process begins when a client initiates a DNS request. The recursive resolver (local DNS server) first checks its cache to see if it already has the requested domain name. If it does, it responds to the client with the cached IP address and the authoritative flag set to zero. If the information is not in the cache, the recursive resolver queries the root server, which directs the query to the appropriate Top-Level Domain (TLD) server. The TLD server in turn directs the query to the authoritative name server for the domain in question. The authoritative server responds with the IP address of the domain name, which the recursive resolver caches before responding to the client. Finally, the client accesses the domain using the IP address it received from its local DNS resolver. So yes, your understanding is correct.

I hope this has been helpful!

Laz

Wow, I was so happy to learn the subtle nuances you mentioned. DNS was something I had some trouble understanding and you made it easy for me to understand. Thank You @lagapidis :pray:t2:

1 Like