What is a DNS lookup?
A DNS lookup typically refers to the process of converting easy to remember names called domain names (like www.google.com) into numbers called IP addresses (like 192.168.2.1).
Computers use these numbers to communicate with each other on the Internet, but these numbers would be difficult for humans to remember and can change from time to time when network configuration changes are required.
A great way to think of a DNS lookup is similar to the contact list on your phone, but a special one where it has everybody’s name without them having told you their number, and if they get a new number, your phone automatically updates it. You don’t need to remember each of your contact’s numbers, but searching for their name is quick and easy. When you select their name to make a call, your phone will automatically use their current phone number.
What DNS record types can be looked up?
There are many different types of DNS records which are used for different purposes, for example the domain name www.example.com may host a website (A record), send and receive email (MX record), as well as use a VoIP service (SRV record). Different DNS record types are used to configure each of these services.
The DNS lookup tool lets you perform a DNS lookup for any domain name on the below record types.
A Record Lookup – Address or IPv4 DNS records, these store IP addresses for domain names.
AAAA Record Lookup – Address v6 or IPv6 DNS records, same as A records but store IPv6 IP addresses.
CAA Record Lookup – Certificate Authority Authorization DNS records are used to store which certificate authorities are allowed to issue certificates for the domain.
CNAME Record Lookup – Canonical Name or sometimes known as Alias records are used to point to other DNS records. Often used for subdomains like www.
MX Record Lookup – Mail Exchanger DNS records are used to store which email servers are responsible for handling email for the domain name.
NS Record Lookup – Nameserver DNS records store the authoritative nameserver for a domain name.
PTR Record Lookup – Pointer or reverse DNS records. This is the opposite of A or AAAA DNS records and is used to turn an IP address into a hostname.
SOA Record Lookup – Start of Authority DNS records store meta details about a domain name such as the administrator contact email address and when the domain last had changes made to its DNS configuration.
SRV Record Lookup – Service DNS records store protocol and port numbers for services offered by the domain name, for example VoIP or chat server.
TXT Record Lookup – Text records are used to store notes as DNS records, however they are typically used to store configuration settings for various services like SPF records which are used to define which email servers are allowed to send email from the domain or verification codes for some webmaster tools.
How does a DNS lookup work?
The Domain Name System (DNS) is a series of servers located all around the world which store the configuration information of a domain name in order to make the process of converting a domain name into an IP address or other DNS configuration information to more easily access a server.
There are 4 different types of DNS servers involved when performing a DNS lookup. Each DNS server type has a different role to play and may not all be required under certain circumstances.
Recursive Resolver – This is the DNS server that your computer or device communicates with. This DNS server is typically issued to you automatically by your service provider and is geographically located nearby in order to return results as fast as possible. This server will cache DNS record data in order to speed up future DNS lookup requests.
Root Nameserver – The root name server is responsible for returning the IP address of the TLD nameserver. For example, when resolving example.com, the root name server will return the IP address of the TLD name server responsible for .com domain names.
TLD Nameserver – The Top Level Domain (TLD) name server is responsible for returning the authoritative name servers for all domains under the TLD it is responsible for. The .com TLD name server will return results for example.com but not example.org.
Authoritative Nameserver – This is the DNS server for actually storing the DNS configuration data of a domain name.
Example DNS lookup flow
As an example of the flow of events when performing a DNS lookup, this is the order of events that will happen when you request a URL to visit a website like example.com in your web browser.
- A user types the URL example.com into their web browser.
- The user’s computer sends a request to the recursive resolver.
- The recursive resolver then sends a request to the root nameserver which provides the address of the TLD nameserver responsible for .com domain names.
- The root nameserver returns the result of the TLD nameserver to the recursive resolver.
- The recursive resolver sends a request to the .com TLD nameserver which provides the address of the authoritative nameserver responsible for the example.com domain.
- The TLD nameserver returns the result of the authoritative nameserver to the recursive resolver.
- The recursive resolver sends a request to the authoritative nameserver responsible for example.com which provides the DNS records requested.
- The authoritative nameserver returns results to the recursive resolver.
- The recursive resolver returns DNS records containing the IP address to the browser.
- The browser makes a request directly to the IP address of the server hosting the website.
Why are DNS records cached?
When DNS requests are made, the response includes what is known as the Time to Live (TTL) which specifies the number of seconds in which DNS records should be cached for.
Caching typically happens at the recursive resolver being used, as these are typically used by many users on a network with close geographical distance. This will not only speed up subsequent requests for the user who made the original request but all other users using the same DNS resolver.
Caching DNS records can make a big difference to response times as often many authoritative nameservers are located on the other side of the world for international users and if your web browser can skip parts of the full DNS lookup process and just get the IP address of a domain name from a local cache then the request can be sped up significantly.
What is a reverse DNS lookup?
A reverse DNS lookup is the opposite of a regular DNS lookup. Instead of converting a domain name into an IP address, it converts an IP address into a domain name. The DNS server will need to have a PTR record pointing to the domain name.
You can use the DNS lookup tool for PTR records to do a reverse DNS lookup.
How do you do a DNS lookup?
Most of the time, a DNS lookup is something that you do not need to worry about as your operating system, or web browser, will handle this for you automatically when you need to resolve a domain name.
Many operating systems include a DNS lookup tool for performing DNS lookups manually for diagnosing problems. Windows systems provide a command line tool called nslookup and Linux and Mac systems include the powerful dig tool.
Using these command line tools can be complicated and difficult to understand for non-technical people which is why the whatsmydns DNS lookup tool was created to help with quickly performing a DNS check.
As an online alternative, all you need to do is simply enter the domain name that you want to perform a DNS lookup against and the results will be displayed right in your web browser. This provides even novice users with an easy to use DNS lookup.