2

On one of my linux machines the BIND package is not installed. The Bind package provides a lot of terminal tools like host -v, nslookup, dig, etc. If I want to have shell tools or command-line tools with similar functionality, like say querying the dns servers which are setup in the /etc/resolv.conf file or querying other DNS servers setup in the network configuration what can be used?

Getting BIND installed on that machine would be a pain and lot of hassle.

5
  • 2
    I don't know arch's bind package, but it would seem unlikely that it's the same package that actually installs the resolver component. Have you checked that installing that package providing these tools is actually as much hassle as you think? Commented Oct 21 at 16:28
  • 2
    @MarcusMüller It looks like arch combines packages that are normally separated on other distributions into a single package. Still, the OP can install the bind package in order to get the tools, but leave bind itself unconfigured and disabled. Commented Oct 21 at 18:32
  • @doneal24 Which works out because Arch doesn't insist on immediately configuring and starting every single service found within a package; the default is disabled. (Unlike other distributions where installing e.g. the rsync tool also results in a rsyncd daemon automatically running.) Which may be what OP is afraid of. Commented Oct 21 at 20:18
  • 1
    is libc's "getent" command available? try getent ahostsv4 one.one.one.one Commented Oct 21 at 21:29
  • @grawity even distributions that usually configure daemons don’t configure rsync --daemon automatically ;-). Commented Oct 22 at 9:39

1 Answer 1

2

This is an incomplete list of DNS libraries that have utility resolving programs:

  • adns
  • bind
  • unbound
  • knot

A few are written in Rust, I am unsure of how conveniently they are packaged on Arch.

  • domain
  • hickory
  • rustdns

Or use a scripting language to write a one liner or more general script.

Note that standard library name resolving probably does getaddrinfo and not merely DNS, so consider using libraries that only do DNS. Incomplete list:

  • Python dnspython
  • Perl Net::DNS
  • PHP pear/net_dns2

In all cases, pay attention to which DNS servers are used. Command line option, config file possibly /etc/resolv.conf default, or a recursive query all the way to root servers.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.