大网数据广告活动
服务器运维问答

DNS searching with wildcards?

· 52CE 我爱测

Anything like nslookup or dig offer the ability to search based on something contained in the name ... like a wildcard search or something? I'm trying to make a little script with a GUI wrapper for our helpdesk team. Ideally, I'd…

问题原文

原帖链接 · TryTryAgain · CC BY-SA 3.0

Anything like nslookup or dig offer the ability to search based on something contained in the name ... like a wildcard search or something?

I'm trying to make a little script with a GUI wrapper for our helpdesk team. Ideally, I'd like them to be able to search the user's last name (something that is always present in the DNS record) and then I'll populate a pulldown with the possible options to choose from.

I'm unable to find a way to effectively have the equivalent of nslookup *miller* ... it would be great to then get back

Name: sf-jacobmiller.localdomain.com
Address: 10.10.10.121

Name: sf-justinmiller.localdomain.com
Address: 10.10.10.144

..which I could then parse into a pulldown for them to pick from.

I have not yet looked into what's available with ldapsearch which may be able to do what I'm looking for. My only requirement is that this is built into OSX and I won't need to install anything else, otherwise I'm open to any solutions you can offer. Thanks

社区高分解答

原帖链接 · dartonw · CC BY-SA 3.0

A name server will not, by design, let you search a zone or query what zones it is authoritative for. Beyond the obvious reason of reducing attack vectors (you can't make a HTTP/1.1 request to a host if you don't know its name), there is a very good reason for this: a zone can contain wildcards itself, so asking for every host in such a zone is like dividing by zero.

If you operate the name server whose records you want to search, you can do a zone transfer to a local name server and search the records directly. You will still need to parse the text records in whatever format they are transferred in, as a local name server will not respond any differently.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-03-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。