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 to use Linux nslookup command help and DNS to find

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

In this issue, the editor will bring you about how to use Linux nslookup command help and DNS search. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Nslookup stands for "name server lookup" and is a useful command to get information from a DNS server. It is also useful for solving DNS-related problems by querying the DNS (Domain name Server) and getting the DNS record of any domain of the IP address.

DNS Lookup example

Use the following command to find the address record for the domain. It queries the domain name server and gets more information.

# nslookup google.comServer: 8.8.8.8Address: 8.8.8.8#53Non-authoritative answer:Name: google.comAddress: 216.58.219.206

Reverse DNS lookup

You can also use ip addresses for reverse dns lookups, and you can use IP addresses to resolve the corresponding domains. It is important to note that this is a different record configured in the reverse area of the domain.

# nslookup 216.58.219.206Server: 8.8.8.8Address: 8.8.8.8#53Non-authoritative answer:206.219.58.216.in-addr.arpa name = lga25s40-in-f14.1e100.net.206.219.58.216.in-addr.arpa name = lga25s40-in-f14.1e100.net.206.219.58.216.in-addr.arpa name = lga25s40-in-f206.1e100.net. 206.219.58.216.in-addr.arpa name = lga25s40-in-f206.1e100.net.

Query a specific DNS server

You can also query specific DNS servers. Additional parameters need to be passed for the name server IP address or domain name. For example, to query the 8.8.4.4 name server, use the following command.

# nslookup google.com 8.8.4.4Server: 8.8.4.4Address: 8.8.4.4#53Non-authoritative answer:Name: google.comAddress: 216.58.219.206

Find the SOA record of a domain

Use nslookup to find the SOA (Authorization start) record for any domain. For example, to find the SOA record for the domain google.com, you can use the following command. You need to specify type-type=soa as the command line argument.

# nslookup-type=soa google.comServer: 8.8.8.8Address: 8.8.8.8#53Non-authoritative answer:google.com origin = ns4.google.com mail addr = dns-admin.google.com serial = 159912615 refresh = 900retry = 900expire = 1800 minimum = 60Authoritative answers can be found from:

Origin: the authority of the source of information.

Mail addr: the email address of the domain administrator (the first dot represents the @ symbol in the email address).

Serial: revision data for the region of the domain, formatted as YYYYMMDDNN.

Refresh: the secondary name server checks the primary name server for the referh interval (in seconds) of the updated version of the zone.

Retry: the time to wait for the secondary name server before attempting to reconnect to the primary name server after a failed attempt.

Expire: the time in seconds that the secondary name server cache expires.

Minimum: if no time has elapsed since the last refresh, the time in seconds for the cache of the secondary name server should not be flushed.

Find the MX record of a domain

You can also query the MX (mail exchange) records of any domain, which are responsible for e-mail delivery.

# nslookup-query=mx google.comServer: 8.8.8.8Address: 8.8.8.8#53Non-authoritative answer:google.com mail exchanger = 10 aspmx.l.google.com.google.com mail exchanger = 30 alt2.aspmx.l.google.com.google.com mail exchanger = 50 alt4.aspmx.l.google.com.google.com mail exchanger = 40 alt3.aspmx.l.google.com.google.com mail exchanger = 20 Alt1.aspmx.l.google.com.Authoritative answers can be found from:

Find the TXT record of a domain

TXT records are useful for many types of records, such as DKIM, SPF, and so on. You can use the following command to find all TXT records configured for any domain.

# nslookup-query=txt google.comServer: 8.8.8.8Address: 8.8.8.8#53Non-authoritative answer:google.com text = "v=spf1 include:_spf.google.com ~ all" Authoritative answers can be found from:

Find all records of the domain

Use-query=any to list all records for any domain.

# nslookup-query=any google.comServer: 8.8.8.8Address: 8.8.8.8#53Non-authoritative answer:Name: google.comAddress: 216.58.219.206google.com has AAAA address 2607:f8b0:4006:80e::200egoogle.com mail exchanger = 20 alt1.aspmx.l.google.com.google.com mail exchanger = 40 alt3.aspmx.l.google.com.google.com nameserver = ns2.google.com.google. Com nameserver = ns4.google.com.google.com nameserver = ns3.google.com.google.com rdata_257 = 0 issue "pki.goog" google.com mail exchanger = 30 alt2.aspmx.l.google.com.google.com mail exchanger = 10 aspmx.l.google.com.google.com mail exchanger = 50 alt4.aspmx.l.google.com.google.com text = "v=spf1 include:_spf.google.com ~ all" google.com nameserver = ns1.google.com.google.com rdata_257 = 0 issue "symantec.com" google.com origin = ns2.google.com mail addr = dns-admin.google.com serial = 159912615 refresh = 900retry = 900expire = 1800 minimum = 60Authoritative answers can be found from:

Nslookup is in interactive mode

We can also use nslookup in interactive mode. To enter interactive mode, enter nslookup on the console and press Enter. You will get a nslookup prompt, such as >. Here, you can run the same query and get the domain information from the DNS server. For better understanding, comments are added between commands.

Root@tecadmin:~#nslookup### Type domain name to get information from dns server > google.comServer: 8.8.8.8Address: 8.8.8.8#53Non-authoritative answer:Name: google.comAddress: 172.217.10.46 Set the another specific dns server to query. > server 8.8.4.4 Default server: 8.8.4.4Address: 8.8.4.4 This time nslookup connects to specified dns server # Again try to get the dns information. > google.com Server: 8.8.4.4Address: 8.8.4.4#53Non-authoritative answer:Name: google.comAddress: 172.217.10.46 Set the query type. For example to get MX information set query=mx > set query=mx # Again try to get the dns information This time nslookup will show MX information for domain > google.com Server: 8.8.4.4Address: 8.8.4.4#53Non-authoritative answer:google.com mail exchanger = 30 alt2.aspmx.l.google.com.google.com mail exchanger = 50 alt4.aspmx.l.google.com.google.com mail exchanger = 40 alt3.aspmx.l.google.com.google.com mail exchanger = 10 aspmx.l.google.com.google. Com mail exchanger = 20 alt1.aspmx.l.google.com.Authoritative answers can be found from: this is how the editor shares how to use the Linux nslookup command to help and find DNS. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow 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

Servers

Wechat

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

12
Report