sudo cp -p /etc/network/if-up.d/resolved /etc/network/if-up.d/.resolved.broken-orig

#Edit /etc/network/if-up.d/resolved and take out the extraneous quotes on lines 48 and 52
#The fix looks like:
diff /etc/network/if-up.d/.resolved.broken-orig /etc/network/if-up.d/resolved
< "$DNS"="$NEW_DNS"

At least, this appears to be effective.

Recently upgraded an older system to Ubuntu 22.04.1 LTS via do-release-upgrade and ran into DNS issues, error messages were:

nslookup google.com

** server can't find google.com: SERVFAIL


/etc/network/if-down.d/resolved: 12: mystatedir: not found
/etc/network/if-up.d/resolved: 71: DNS: not found
/etc/network/if-up.d/resolved: 1: /run/network/ifupdown-inet-em1: DNS= not found
/etc/network/if-up.d/resolved: 2: /run/network/ifupdown-inet-em1: DOMAINS=local_search_domain.com: not found
Failed to parse DNS server address: DNS
Failed to set DNS configuration: Invalid argument

when attempting to run an nslookup via a network connection (em1) defined in /etc/network/interfaces prior to the system upgrade.

After a period of self-soothing I located https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1981103 and https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1910273 which helped enhance my calm. It appears that, at a minimum, the errors encountered were due to a pair of typos in /etc/network/if-up.d/resolved which are easily fixed with a text editor; after manually removing the extraneous quotes I am able to bring up the network interface and query DNS servers. It's unclear to me if there are other issues with the ifupdown package currently shipped by Ubuntu 22.04.1 LTS (0.8.36+nmu1ubuntu3) or the manual edit I described above. Are there any documented fixes that don't involve editing lines 48 and 52 of /etc/network/if-up.d/resolved or is this the best workaround currently available for legacy systems that have been upgraded to Ubuntu 22.04.1 LTS?

  • You haven't provided enough information. What happens and what are you trying to achieve?
    – telometto
    Aug 26, 2022 at 15:23

1 Answer 1


I bumped my Ubuntu server 18.04->22.04 and ran into this issue. As you clearly stated (thank you!) updating /etc/network/if-up.d/resolved and removing 2 quoted variables in such a way:

sudo vim /etc/network/if-up.d/.resolved.broken-orig

Old: "$DNS"="$NEW_DNS"
New: $DNS="$NEW_DNS"


Solves this problem after a reboot.

  • 2
    Exactly what I needed! Thank you!
    – aaiezza
    Jan 10 at 20:17
  • Note that the link posted by OP has the complete set of fixes required. It is not just these two lines (at least in my case). Also, if-down.d also requires fixes.
    – Domi
    Feb 17 at 15:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .