What is DNS Lookup?
A domain has a number of records associated with it, a DNS server can be queried to determine the IP address of the primary domain (A record), mail servers (MX records), DNS servers (NS nameservers) and other items such as SPF records (TXT records).
Types of DNS Records:
- A record: Address record maps a hostname to a 32-bit IPv4 address.
- AAAA record: IPv6 address record maps a hostname to a 128-bit IPv6 address.
- CNAME record: Canonical name record is an alias of one name to another.
- MX record: Mail exchange record maps a domain name to a list of mail exchange servers for that domain.
- PTR record: Pointer record maps an IPv4 address to the canonical name for that host. Setting up a PTR record for a host name in the in-addr.arpa domain that corresponds to an IP address implements reverse DNS lookup for that address.
- NS record: Name server record maps a domain name to a list of DNS servers authoritative for that domain.
- SOA record Start of authority record specifies the DNS server providing authoritative information about an Internet domain.
- SRV record: It is a generalized service location record.
- TXT record: This record is used to implement the Sender Policy Framework.
Name Server Lookup Is A Command-line Tool
Nslookup (Name Server Lookup) is a command-line tool that queries the Domain Name System (DNS) and retrieves information about domain names, IP addresses, and DNS records.
Here are some popular uses of nslookup:
- Domain Name Resolution: Nslookup allows you to retrieve the IP address associated with a domain name. You can query the DNS server and obtain the corresponding IP address by entering a domain name. This is useful for troubleshooting network connectivity issues or verifying DNS configurations.
- DNS Record Lookup: Nslookup can be used to query different types of DNS records associated with a domain name, such as A records (IPv4 address), AAAA records (IPv6 address), MX records (mail exchange), CNAME records (canonical name), TXT records (text), etc. This helps in verifying DNS configurations and diagnosing DNS-related problems.
- Reverse DNS Lookup: With nslookup, you can perform a reverse DNS lookup by entering an IP address and obtaining the associated domain name. This can be useful in determining the hostname associated with an IP address or identifying the owner of an IP address.
- DNS Server Testing: Nslookup allows you to query specific DNS servers directly. This can help test the responsiveness and accuracy of DNS servers, diagnose DNS resolution issues, or verify DNS caching behavior.
- Troubleshooting Network Issues: Nslookup is a handy tool for troubleshooting network issues related to DNS. By querying DNS records and resolving domain names, you can identify DNS misconfigurations, DNS resolution failures, or inconsistencies in DNS responses.
- Verifying DNS Propagation: When you make changes to your DNS settings, such as updating DNS records or changing name servers, nslookup can be used to verify if the changes have propagated across the DNS infrastructure. You can check if the updated DNS records are visible by querying the DNS server.
- Testing Mail Servers: Nslookup can be used to test and troubleshoot mail server configurations. By querying the DNS MX records of a domain, you can verify the mail server responsible for receiving emails for that domain. This helps in diagnosing email delivery problems.
These are some popular uses of nslookup. It is a versatile tool for DNS-related tasks and can be a valuable asset for network administrators, system administrators, and developers working with networking and DNS configurations.
nslookup Non-interactive Mode
Let’s look at some commands you can execute with nslookup in the non-interactive mode.
- Display the IP address of a hostname
- Perform a reverse DNS lookup
- Display MX records
nslookup -query=mx [website-name]
- Display NS records
nslookup -query=ns [website-name]
- Display an SOA record
nslookup -query=soa [website-name]
- Display all DNS records
nslookup -query=any [website-name]
- Use a different port number
nslookup -port=[port-number] [website-name]
Nslookup is one of the popular command-line software for DNS probing. You can use it to monitor your network and spot problematic areas.
How Do I Speed Up DNS Propagation?
There are methods to speed up the propagation process of DNS. One of them is to choose a reliable service like those that were mentioned earlier.
Another one is to increase propagation speed is to make sure that your DNS zone's TTL is at a very low level.
If you are moving your website and making DNS modifications, you'll want the DNS transition to be as quick as is possible.
You can change the TTL you are currently using and reduce the time needed before performing the migration. 600 (10 minutes) is an excellent TTL value. You must make the change within 24 hours in advance of the transfer. Ten minutes before you make your change. You could set it lower, down to sixty (1 min).
This setup has been proven to be effective in speeding up the propagation of DNS.
After this server delivers your traffic, you can return the TTL to its normal value.
Which DNS server should you use?
The DNS server's authority is critical to the Internet's security. You can end up on the wrong website if your DNS results are incorrect. There are 13 Root Servers with the highest authority stationed throughout the world. Large corporations, such as Google, offer free public DNS services (18.104.22.168) for regular use.
If you don't specify a default DNS server in your computer, your ISP (internet service provider) will find a random DNS server for you, which may or may not be as good as Google's public DNS services (22.214.171.124). It's simple to set up, and you should use one of the public DNS servers instead of your computer's default DNS server.