How to query a DNS server ?
Name resolution is essential to the proper functioning of the Web. This translates complex network addresses into simple terms suitable for Internet users. However, it is sometimes necessary to use an IP address in case of failures of this system.
This technique also helps authenticate the target web server and detect any DNS redirection.
How the DNS server works ?
The DNS is one of the elements that contributed to the expansion and success of the Web. Indeed, the system has facilitates the adhesion to the network and the use of this technology. What is a DNS ? The Domain Name System is a distributed service that can be considered as a directory for computer names.
This non-centralized model has contributed to its integration into the basic protocols of the Internet.
Like the classic directory, the DNS This is where names and coordinates are linked together. However, it associates domain names and server IP addresses. These two pieces of information constitute the DNS records.
Given the number of connected hosts, the network would have been affected by the centralization of this data. The system has so distribute the records between domains, sub-domains and DNS zones.
In practice, the Internet’s virtual directory is managed by a myriad of servers around the world. All the computers on the network can query a DNS server to get a domain name or IP address. If it does not find this information, it will in turn query name servers at another level.
Thus, it will bring up the initial DNS queries in the authority tree.
If there is no match, the request will be forwarded to the authoritative server in the domain. The administrators take care of the management of the DNS zone (aliases, IP addresses, DNS servers…). In particular, they can modify, delete or add entries in the master server.
On their side, the slave servers only have copies of these zone files.
How to find your server ?
Before queryingquery a DNS server, it is important to check your connection settings. This initiative allows you to analyze your local network, your default gateways, your IPv4 and IPv6 addresses… This step is also essential if you have decided to configure a DNS server per device (PC, mobile, router, etc.).). In this case, it is quite difficult to identify the priority settings.
To be sure, use the ” ipconfig A “command line” executable from the Windows command prompt. Moreover, the necessary line is easy to remember. Just write ” ipconfig /all “to get all the details about your DNS server.
If you make a typo, CMD will automatically display the Help section with a list of exact formulas. Select the command, copy, paste and press Enter.
You can also enter ” ipconfig “to get a summary of your Internet Protocol configuration. The results will contain the name and address of your system’s DNS server. If you are not familiar with CMD, use the keyboard shortcut Window+R to launch the Run tool. Write ” cmd ” and validate (Enter key or OK button).
The command prompt will then appear in the foreground.
Finally, there are third-party applications to check the nameserver on Android or iOS mobiles. Several are free to download on the Play Store or the App Store. These tools are particularly useful if you can’t recognize the DNS server of your Internet Service Provider (ISP).
Indeed, your connected devices will be configured by default according to the DNS configuration of the Wi-Fi.
How to query a DNS server ?
” nslookup “is the program par excellence for query a DNS server on most operating systems. The function is natively available on Windows, macOS and Linux distributions. However, the developers recommend to prefer “dig” or “host for OS type Unix.
In any case, these three tools allow you to look up information on DNS.
” host “is concise and easy to use. To find an IP address, simply enter in the terminal: $ host [domain name]. The Unix utility also covers reverse DNS. This time, you will have to fill in: $ host [IP address].
The corresponding host will be displayed on the next line. “dig” also works on the command line. Its name comes from the English ” domain information groper “.
This Unix client is available in the packages ” dnsutils ” for Linux and ” bind utils ” for Fedora. To request a basic DNS record, run the line :
# dig [domain name]. This query returns the IP address of the target domain. You can also add specifications for other types of records. You will have :
# dig [domain name] (+short, MX, TTL, SOA…).
Finally, ” nslookup nslookup ” allows you to send specific requests such as Mail Server (MX), Pointer (PTR), Start of Authority (SOA)… You will simply receive an IP address with the command: nslookup [domain name]. For a specified domain, skip to the line after each entry:
>set type=[IPv4, IPv6, SOA, MX, NS, PTR, etc.]
After activating “nslookup”, don’t hesitate to run the “help” command to discover all the associated features.