Skip to content

systemd nss-lookup.target is reached before unbound can successfully answer queries #296

@xnoreq

Description

@xnoreq

Running unbound 1.11.0 (pkg) on arch linux.
Other services rely on nss-lookup.target being reached when name resolution is actually working.

To demonstrate the issue I've created the following "check-name-resolution.service":

[Unit]
Description=check name resolution
After=network.target network-online.target nss-lookup.target

[Service]
Type=oneshot
User=nobody
ExecStart=/usr/bin/drill google.com

[Install]
WantedBy=multi-user.target

After a reboot (!) the journal shows this:

-- Reboot --
systemd[1]: Starting Validating, recursive, and caching DNS resolver...
unbound[329]: [329:0] notice: init module 0: subnet
unbound[329]: [329:0] notice: init module 1: validator
unbound[329]: [329:0] notice: init module 2: iterator
unbound[329]: [329:0] info: start of service (unbound 1.11.0).
systemd[1]: Started Validating, recursive, and caching DNS resolver.
systemd[1]: Reached target Host and Network Name Lookups.
systemd[1]: Starting check name resolution...
sh[340]: ;; ->>HEADER<<- opcode: QUERY, rcode: SERVFAIL, id: 60132
sh[340]: ;; flags: qr rd ra ; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
sh[340]: ;; QUESTION SECTION:
sh[340]: ;; google.com.        IN        A
sh[340]: ;; ANSWER SECTION:
sh[340]: ;; AUTHORITY SECTION:
sh[340]: ;; ADDITIONAL SECTION:
sh[340]: ;; Query time: 29 msec
sh[340]: ;; SERVER: ::1
sh[340]: ;; WHEN: Sun Aug 30 15:47:16 2020
sh[340]: ;; MSG SIZE  rcvd: 28
systemd[1]: check-name-resolution.service: Succeeded.
systemd[1]: Finished check name resolution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions