Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does the Linux system view the dns parsing tool

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you how the Linux system to view dns parsing tools, the content is easy to understand, clear, hope to help you solve your doubts, the following let Xiaobian take you to study and learn "Linux system how to view dns parsing tools" this article.

1. Dig command

Dig is a Unix-like command-line mode to query DNS, including NS records, A records, MX records and other related information tool. The source code of Dig is part of the ISC BIND package, but it is not included in most documents that compile and install Bind, but in linux systems, it is usually part of a package, bind-tools in Gentoo, bind-utils in Redhat/Fedora, or dnsutils in Debian.

1. Dig-DNS lookup utility

When there is an access failure of a domain name, you can check the domain name resolution to determine whether the problem is caused by incorrect resolution.

Domain name resolution has no result (does not exist or is not verified by HOLD, etc.)

Domain name is resolved to the wrong IP (blocked and hijacked in response to the error result, and the resolution process needs to be judged)

The value of the corresponding CNAME record cannot be parsed

Partial resolution exception (when configuring multiple domain name servers, the resolution results of multiple servers are inconsistent. You need to confirm whether the resolution records added on the DNS server are consistent)

To parse the www.baidu.com easily, the results are as follows:

You can see that there are request segment and reply segment, and the final parsed A record has two.

2. Dig command to do iterative query

Add + trace after the command to track the entire parsing process:

Parsing process:

Find the top-level domain name server responsible for resolving .com by the root domain name server

Find the secondary domain name server of baidu.com by the top-level domain name server

Www.baidu.com corresponding to a CNAME record www.a.shifen.com is found by the secondary domain name server.

Then find the A record corresponding to www.a.shifen.com.

Finally, the IP address of A record is returned.

3. How does the dig command return when the domain name does not exist

For example, the resolution of the domain name www.not-exists-domain.com does not exist.

The whole process is as follows:

Returns the server address of the .com top-level domain from the root domain

Check from the .com top-level domain that the second-level domain does not exist and return a SOA record

2. Nslookup-query Internet name servers interactively

Nslookup is a network management command line tool that can be used to query DNS domain names and IP address input instructions nslookup default server and Address is the current DNS server domain name and address A record A (Address) record refers to the IP record used to specify the host name or domain name. Enter the domain name directly after the prompt >, you can view the A record of the domain name (you can also set it with the set type=an instruction): MX record MX (mail exchanger) record, mail exchange record, which points to a mail server, which is used by the e-mail system to locate the mail server according to the address suffix of the recipient when sending e-mail. Enter set type=mx, and then enter the domain name to query the mx type record MX perference = 10 refers to the priority NS record NS (nameserver) record of the MX record, which is used to specify which DNS server to resolve the domain name. Enter set type=ns first and then the domain name CNAME record cname record is an alias record and also becomes a standard name. This kind of record allows multiple names to be mapped to the same computer. Enter set type=cname to query n.

Slookup can be used in both interactive and non-interactive ways as shown in the following figure:

Nslookup can also specify the resolution command format to a domain name server as follows:

Nslookup www.baidu.com 8.8.8.8 (domain name server address)

You can check the current usage of port 80 by adding the wc-l command.

What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.

The above is about "Linux system how to view dns parsing tool". If this article is helpful to you and you think it is well written, please share it with your friends to learn new knowledge. if you want to know more about it, please pay more attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report