There are multiple command-line solutions available on Linux. Several of them come even pre-installed, but most of them are at least available via the standard repositories. Note that I'm also using the Unbound name server in my local network here :)
nslookup
This tool ships with the dnsutils
package – which in fact is described as Clients provided with BIND, but definitely does not require bind itself (though it uses one of its libraries, libbind
). As you requested, it supports an optional parameter to specify which name server to use (by default it checks which one is configured with your system):
nslookup example.org 4.2.2.4
would request the IP of example.org
from a name server listening at port 53 at 4.2.2.4
. There's an interactive command-line interface as well, and you can specify which type of address you're looking for – e.g. type=mx
for the SMTP MX records of a domain, or type=ns
for the name servers.
dig
As nslookup
was declared "deprecated" a while ago, today one should use dig
. By default, dig
produces much more detailed output. The syntax here would be:
dig example.org @4.2.2.4
for the same task described above. And again, specifying a name server is optional. Interestingly, the dig
tool comes with the very same package, at least on Ubuntu: dnsutils
.
dnsip
This candidate seems to be completely independent from any bind library. It belongs to the djbdns name server which was written from the scratch for exactly the same reasons you're looking after a replacement to bind, and is described e.g. in this article. You can find it in the Ubuntu repositories as udns-utils
, the same on Debian Jessie (Wheezy seems not to have it). But unfortunately, dnsip
does not support specifying the name server at the command line.
dig example.org @4.2.2.4
ornslookup example.org 4.2.2.4
?bind
installed on my workbench, still I have all 3 available. Let me write up an answer.dig
, as they both ship in the same package. But they only require that one library, not the entire bind server package. Is "not depending on bind or its libraries in any way" a requirement for the software you're looking for? You didn't say so :) // PS: Related on Unix&Linux: alternative to nslookup in rhel7?