问题原文
原帖链接 · 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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
