3

nslookup的querytype 详解

 2 years ago
source link: https://hellodk.cn/post/563
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

你见到过哪些有趣的加群链接?

  • 通过 base64 或者其他方式加密的字符串,将它解密就能获取加群url
  • 通过一个阅后即焚或者有时效性的url,点击即可看到链接,几天后链接过期了,你也就无法通过这个链接加入群了
  • 微信或者其他软件的二维码,一般都有时效性

今天看到一个通过 dns txt 记录值保存加群链接的,还是第一次看到~

c9719df7eff9a428ddf067b88b76b73.png

类unix系统

通过 nslookup -querytype=TXT xxx.org 就能在终端快速查询到加群链接,这里得到的查询结果一般情况下都是非权威应答。除非是请求到所在主机才查到目标IP才是权威应答。

20210602171857.png

windows系统

cmd 下使用 nslookup -qt=TXT xxx.org 就能在cmd终端快速查询到加群链接


扩展:与nslookup 类似的命令有dig,实现本文的需求,也可以使用dig命令查询

[root@justhostRU ~]# dig xxx.org TXT
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-16.P2.el7_8.6 <<>> xxx.org TXT
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11340
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;xxx.org. IN TXT
;; ANSWER SECTION:
xxx.org. 599 IN TXT "https://t.me/xxx"
;; Query time: 423 msec
;; SERVER: 77.88.8.8#53(77.88.8.8)
;; WHEN: Fri Jun 04 15:32:00 CST 2021
;; MSG SIZE rcvd: 100

下面简单学习一下 nslookup

功能: query Internet name servers interactively (交互式)查询互联网域名

nslookup [-option] [name | -] [server]

功能详细描述:

Nslookup is a program to query Internet domain name servers. Nslookup has two modes:
interactive and non-interactive. Interactive mode allows the user to query name servers for
information about various hosts and domains or to print a list of hosts in a domain.
Non-interactive mode is used to print just the name and requested information for a host or
domain.

Nslookup 是一个查询 Internet 域名服务器的程序。
Nslookup 有两种模式:交互式和非交互式。

  • 交互模式允许用户查询名称服务器有关各种主机和域的信息或打印域中的主机列表。
  • 非交互模式用于仅打印主机的名称和请求的信息或领域。

下面来学习一下 querytype 也就是 dns record 到底有哪些记录

该选项默认值是A,也就是执行 nslookup baidu.com 默认查询 A记录,也就是 Address 地址

querytype Specifies a DNS resource record type. The default resource record type is A, but you can use any of the following values:

  • A: Specifies a computer's IP address.
  • ANY: Specifies a computer's IP address.
  • CNAME: Specifies a canonical name for an alias.
  • GID Specifies a group identifier of a group name.
  • HINFO: Specifies a computer's CPU and type of operating system.
  • MB: Specifies a mailbox domain name.
  • MG: Specifies a mail group member.
  • MINFO: Specifies mailbox or mail list information.
  • MR: Specifies the mail rename domain name.
  • MX: Specifies the mail exchanger.
  • NS: Specifies a DNS name server for the named zone.
  • PTR: Specifies a computer name if the query is an IP address; otherwise, specifies the pointer to other information.
  • SOA: Specifies the start-of-authority for a DNS zone.
  • TXT: Specifies the text information.
  • UID: Specifies the user identifier.
  • UINFO: Specifies the user information.
  • WKS: Describes a well-known service.

以上 dns record type ➡️️ 原文戳我 常用的记录值也就是 A AAAA CNAME MX NS TXT

关于 nslookup command, ibm 官方文档和 man nslookup 差不多: https://www.ibm.com/docs/en/aix/7.2?topic=n-nslookup-command

推荐:一个不错的在线解析dns网站,包含多种记录返回。 戳我


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK