unbound resolver ready for URL

Hello

How to determine when “unbound resolver” is ready for a URL to be resolved ?

Before making URL query requests, I wait for “unbound resolver” to come up.

The method I used is by detecting the unbound pid file.

This seems to work most of the time, but not always.

"Modster, Anthony via Unbound-users" writes:

> How to determine when "unbound resolver" is ready for a URL to be resolved?

URL? You mean, resolving DNS.
>
> Before making URL query requests, I wait for "unbound resolver" to come up.
> The method I used is by detecting the unbound pid file.
> This seems to work most of the time, but not always.

One can do unbound control-status and something like

  version: 1.13.1
  verbosity: 2
  threads: 4
  modules: 3 [ validator cachedb iterator ]
  uptime: 72528 seconds
  options: control(ssl)
  unbound (pid 738) is running...

is the result. But in most systems, services like DNS are running before one can login.

  jaap

If you’re on a recent Linux you can probably also check systemd to see if unbound is running. There’s a D-Bus interface that should do the job.

-FG

Thanks

Teledyne Confidential; Commercially Sensitive Business Data