...
How to resolve "temporary failure in name resolution" on ubuntu vps
Learn how to resolve “temporary failure in name resolution” on ubuntu vps!

:root {
–text: #1f2933;
–muted: #52606d;
–bg: #ffffff;
–bg-alt: #f5f7fa;
–border: #e4e7eb;
–accent: #0b6bcb;
–accent-dark: #084f96;
–code-bg: #0f172a;
–code-header: #1e293b;
–code-text: #e2e8f0;
–code-comment: #7c8ba1;
–inline-code-bg: #eef2f7;
–inline-code-text: #c2255c;
–note-bg: #eaf4ff;
–note-border: #0b6bcb;
–warn-bg: #fff8e6;
–warn-border: #e8a400;
–ok: #18794e;
–fail: #c92a2a;
–radius: 8px;
–mono: “JetBrains Mono”, “Fira Code”, “SFMono-Regular”, Consolas, “Liberation Mono”, Menlo, monospace;
–sans: -apple-system, BlinkMacSystemFont, “Segoe UI”, Roboto, “Helvetica Neue”, Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: var(–sans);
font-size: 17px;
line-height: 1.7;
color: var(–text);
background: var(–bg);
}
.kb-article {
max-width: 880px;
margin: 0 auto;
padding: 48px 24px 80px;
}
h2 {
font-size: 2.1rem;
line-height: 1.25;
margin: 0 0 12px;
letter-spacing: -0.01em;
}
.kb-meta {
color: var(–muted);
font-size: 0.92rem;
margin-bottom: 32px;
padding-bottom: 20px;
border-bottom: 1px solid var(–border);
}
.kb-meta span + span::before { content: “·”; margin: 0 8px; }
h3 {
font-size: 1.5rem;
margin: 56px 0 16px;
padding-top: 8px;
scroll-margin-top: 20px;
}
h4 {
font-size: 1.15rem;
margin: 32px 0 10px;
scroll-margin-top: 20px;
}
p { margin: 0 0 16px; }
a { color: var(–accent); text-decoration: none; }
a:hover { color: var(–accent-dark); text-decoration: underline; }
ul, ol { padding-left: 24px; margin: 0 0 16px; }
li { margin-bottom: 6px; }
hr { border: 0; border-top: 1px solid var(–border); margin: 48px 0; }

/* Inline code */
code {
font-family: var(–mono);
font-size: 0.86em;
background: var(–inline-code-bg);
color: var(–inline-code-text);
padding: 2px 6px;
border-radius: 4px;
word-break: break-word;
}

/* Code blocks */
.code-block {
margin: 16px 0 24px;
border-radius: var(–radius);
overflow: hidden;
background: var(–code-bg);
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}
.code-header {
display: flex;
justify-content: space-between;
align-items: center;
background: var(–code-header);
padding: 6px 12px 6px 16px;
font-family: var(–mono);
font-size: 0.75rem;
color: #94a3b8;
text-transform: uppercase;
letter-spacing: 0.06em;
}
.copy-btn {
font-family: var(–sans);
font-size: 0.75rem;
text-transform: none;
letter-spacing: 0;
background: transparent;
color: #cbd5e1;
border: 1px solid #334155;
border-radius: 5px;
padding: 3px 10px;
cursor: pointer;
transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.copy-btn:hover { background: #334155; color: #fff; }
.copy-btn.copied { border-color: #22c55e; color: #86efac; }
pre {
margin: 0;
padding: 16px 18px;
overflow-x: auto;
font-family: var(–mono);
font-size: 0.86rem;
line-height: 1.6;
color: var(–code-text);
tab-size: 2;
}
pre code {
background: none;
color: inherit;
padding: 0;
font-size: inherit;
word-break: normal;
}
pre .c { color: var(–code-comment); font-style: italic; }
pre .p { color: #38bdf8; user-select: none; }

/* Callouts */
.callout {
border-left: 4px solid var(–note-border);
background: var(–note-bg);
padding: 14px 18px;
border-radius: 0 var(–radius) var(–radius) 0;
margin: 20px 0 24px;
font-size: 0.95rem;
}
.callout p:last-child, .callout .code-block:last-child { margin-bottom: 0; }
.callout strong:first-child { display: inline-block; margin-right: 4px; }
.callout.warn { border-left-color: var(–warn-border); background: var(–warn-bg); }

See Also: Complete Identity and Access Management Deployment on Ubuntu VPS

/* Tables */
.table-wrap { overflow-x: auto; margin: 16px 0 24px; }
table {
width: 100%;
border-collapse: collapse;
font-size: 0.93rem;
}
th, td {
text-align: left;
padding: 10px 14px;
border-bottom: 1px solid var(–border);
vertical-align: top;
}
th {
background: var(–bg-alt);
font-weight: 600;
border-bottom: 2px solid var(–border);
}
tr:hover td { background: #fafbfc; }

/* TOC */
.toc {
background: var(–bg-alt);
border: 1px solid var(–border);
border-radius: var(–radius);
padding: 20px 24px;
margin: 0 0 32px;
}
.toc-title {
font-weight: 700;
font-size: 0.85rem;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(–muted);
margin-bottom: 10px;
}
.toc ol { margin: 0; columns: 2; column-gap: 32px; }
.toc li { break-inside: avoid; font-size: 0.95rem; }
@media (max-width: 640px) {
.toc ol { columns: 1; }
h2 { font-size: 1.7rem; }
body { font-size: 16px; }
}

.ok { color: var(–ok); font-weight: 600; }
.fail { color: var(–fail); font-weight: 600; }

.summary-list li { margin-bottom: 8px; }
.back-top {
display: inline-block;
font-size: 0.85rem;
margin-top: 8px;
}

This article provides a guide demonstrating how to resolve “Temporary Failure in Name Resolution” on Ubuntu VPS.

Applies to: Ubuntu 20.04, 22.04, 24.04 and newer
Category: Networking / DNS

Overview

The error Temporary failure in name resolution means your server tried to turn a hostname (such as archive.ubuntu.com or google.com) into an IP address and got no answer. The error comes from the system resolver library (getaddrinfo() returning EAI_AGAIN). Common places you will see it:

ping: google.com: Temporary failure in name resolution
Err:1 http://archive.ubuntu.com/ubuntu noble InRelease
  Temporary failure resolving 'archive.ubuntu.com'
curl: (6) Could not resolve host: example.com

In most cases the network itself is working and only DNS is broken. The usual causes on an Ubuntu VPS are:

  • A missing, broken, or overwritten /etc/resolv.conf
  • systemd-resolved is stopped, failed, or has no upstream DNS servers
  • No nameservers are defined in Netplan, or cloud-init has overwritten them
  • A firewall is blocking outbound port 53 (UDP/TCP)
  • The upstream resolver is down or unreachable
  • Clock drift is causing DNSSEC validation to fail
  • On container-based VPS platforms (OpenVZ/Virtuozzo/LXC), the host node is managing DNS

Before you start: Some steps change network configuration. Make sure you can reach your VPS out-of-band (VNC, serial console, or the provider’s web console) in case an SSH session drops.

See Also: 🚀 How to Deploy OPNsense on a Rad Web Hosting VPS

Launch 100% ssd ubuntu vps from $3. 19/mo!


Compare Ubuntu VPS Plans

KVM-SSD-1
KVM-SSD-8
KVM-SSD-16
KVM-SSD-32
CPU
1 Core
2 Cores
4 Cores
8 Cores
Memory
1 GB
8 GB
16 GB
32 GB
Storage
16 GB NVMe
128 GB NVMe
256 GB NVMe
512 GB NVMe
Bandwidth
1 TB
4 TB
8 TB
16 TB
Network
1 Gbps
1 Gbps
1 Gbps
1 Gbps
Delivery Time
⏱️ Instant
⏱️ Instant
⏱️ Instant
⏱️ Instant
Location
US/EU/APAC
US/EU/APAC
US/EU/APAC
US/EU/APAC
Price
$7.58*
$39.50*
$79.40*
$151.22*
KVM-SSD-1
$7.58*
CPU 1 Core
Memory 1 GB
Storage 16 GB NVMe
Bandwidth 1 TB
Network 1 Gbps
Delivery Time ⏱️ Instant
Location US/EU/APAC
KVM-SSD-8
$39.50*
CPU 2 Cores
Memory 8 GB
Storage 128 GB NVMe
Bandwidth 4 TB
Network 1 Gbps
Delivery Time ⏱️ Instant
Location US/EU/APAC
KVM-SSD-16
$79.40*
CPU 4 Cores
Memory 16 GB
Storage 256 GB NVMe
Bandwidth 8 TB
Network 1 Gbps
Delivery Time ⏱️ Instant
Location US/EU/APAC
KVM-SSD-32
$151.22*
CPU 8 Cores
Memory 32 GB
Storage 512 GB NVMe
Bandwidth 16 TB
Network 1 Gbps
Delivery Time ⏱️ Instant
Location US/EU/APAC

How to Resolve “Temporary Failure in Name Resolution” on Ubuntu VPS

To resolve “Temporary Failure in Name Resolution” on Ubuntu VPS, follow the steps below:

  1. Confirm It’s DNS and Not Network Connectivity

    Ping a public IP address directly. This skips DNS completely:

    ping -c 4 1.1.1.1

    Then ping a hostname:

    ping -c 4 google.com
    Result Meaning
    IP works, hostname fails DNS problem. Continue with this guide.
    Both fail Network/routing problem. Check the interface, gateway, and provider network first.
    Both work The problem is intermittent or specific to one application (see Step 10).

    If the IP ping fails, check the interface and default route:

    ip -br addr
    ip route show default

    You should see an interface in the UP state with an IP assigned, plus a default via <gateway> route. If either is missing, fix connectivity before touching DNS.

  2. Inspect /etc/resolv.conf

    ls -l /etc/resolv.conf
    cat /etc/resolv.conf

    On a standard Ubuntu install, /etc/resolv.conf is a symlink to the systemd-resolved stub file:

    /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf

    The contents should include:

    nameserver 127.0.0.53
    options edns0 trust-ad

    127.0.0.53 is the local systemd-resolved stub listener. It forwards queries to the real upstream DNS servers.

    Problems to look for:

    • The file is missing or empty. The resolver has nothing to query.
    • It’s a regular file instead of a symlink. Something (a script, a control panel, or a manual edit) has replaced it.
    • It points to a nameserver that is no longer reachable, such as an old provider resolver.
    • The symlink is broken (shown in red by ls, or cat reports “No such file or directory”).

    Restore the correct symlink

    sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

    If the command fails with Operation not permitted, the file may be marked immutable:

    lsattr /etc/resolv.conf

    If the output includes an i flag, remove it first:

    sudo chattr -i /etc/resolv.conf
    sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
  3. Check the systemd-resolved Service

    systemctl status systemd-resolved

    If it is inactive or failed, enable and start it:

    sudo systemctl enable --now systemd-resolved

    Then check which upstream DNS servers it is actually using:

    resolvectl status

    Look under your primary interface (for example eth0, ens3, or enp1s0) for:

    Current DNS Server: 1.1.1.1
           DNS Servers: 1.1.1.1 8.8.8.8

    Most common root cause: If no DNS servers are listed under the interface or in the Global section, systemd-resolved has nowhere to forward queries. Fix it in Step 4 or Step 5.

    See Also: Deploy FreeIPA on VPS

    Restart the service and flush its cache:

    sudo systemctl restart systemd-resolved
    sudo resolvectl flush-caches

    Test resolution through systemd-resolved directly:

    resolvectl query google.com

    Check for port 53 conflicts

    If systemd-resolved fails to start, another service may already be bound to port 53 (common with dnsmasq, BIND, Unbound, Pi-hole, or AdGuard):

    sudo ss -lntup | grep ':53 '

    If another resolver is meant to handle DNS, point /etc/resolv.conf at it, or disable the systemd-resolved stub listener (see Step 5). Don’t let both compete for the port.

  4. Set DNS Servers Permanently with Netplan (Recommended)

    On most VPS deployments, the network configuration lives in /etc/netplan/. List the files:

    ls -l /etc/netplan/

    Typical filenames include 50-cloud-init.yaml, 01-netcfg.yaml, or 00-installer-config.yaml.

    Edit the file:

    sudo nano /etc/netplan/50-cloud-init.yaml

    Example: static IP configuration

    network:
      version: 2
      ethernets:
        eth0:
          addresses:
            - 203.0.113.10/24
          routes:
            - to: default
              via: 203.0.113.1
          nameservers:
            addresses:
              - 1.1.1.1
              - 8.8.8.8
              - 2606:4700:4700::1111

    Example: DHCP with custom DNS (ignoring DHCP-provided DNS)

    network:
      version: 2
      ethernets:
        eth0:
          dhcp4: true
          dhcp4-overrides:
            use-dns: false
          nameservers:
            addresses:
              - 1.1.1.1
              - 8.8.8.8

    Note: Replace eth0 with your real interface name from ip -br addr. YAML is indentation-sensitive, so use spaces, not tabs.

    Fix the file permissions (Netplan warns if the file is world-readable):

    sudo chmod 600 /etc/netplan/*.yaml

    Validate and apply safely:

    sudo netplan generate
    sudo netplan try

    netplan try applies the configuration and automatically rolls back after 120 seconds unless you press Enter to confirm. This keeps a bad config from locking you out of a remote VPS. Once you’ve confirmed SSH still works, accept it, or run:

    sudo netplan apply

    Verify:

    resolvectl status
    ping -c 4 google.com

    Stop cloud-init from overwriting your changes

    If the file is named 50-cloud-init.yaml, cloud-init may regenerate it on reboot and discard your edits. To stop cloud-init from managing networking:

    echo 'network: {config: disabled}' | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

    After this, your Netplan file is the authoritative source and survives reboots.

  5. Set Global DNS in resolved.conf (Alternative / Fallback)

    If you don’t want to touch Netplan, or you want global fallback resolvers that apply no matter what the interface config says, use a systemd-resolved drop-in:

    sudo mkdir -p /etc/systemd/resolved.conf.d
    sudo nano /etc/systemd/resolved.conf.d/dns.conf
    [Resolve]
    DNS=1.1.1.1 8.8.8.8 2606:4700:4700::1111
    FallbackDNS=9.9.9.9 1.0.0.1

    Apply:

    sudo systemctl restart systemd-resolved
    resolvectl status

    A drop-in file is better than editing /etc/systemd/resolved.conf directly, because package upgrades won’t overwrite it.

    Optional: disable the stub listener

    If you’re running your own resolver on port 53, or an application can’t use 127.0.0.53 (some older software and certain container setups), add:

    See Also: Deploy OWASP Amass on Debian VPS

    DNSStubListener=no

    Then point /etc/resolv.conf at the non-stub file, which lists the real upstream servers:

    sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
    sudo systemctl restart systemd-resolved
  6. Emergency Temporary Fix

    If you need DNS working right now, for example to run apt or download a package, write a nameserver straight into /etc/resolv.conf:

    sudo rm -f /etc/resolv.conf
    echo "nameserver 1.1.1.1" | sudo tee /etc/resolv.conf
    echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf

    This is not a permanent fix. It bypasses systemd-resolved, and it may be overwritten on reboot or by network changes. Once DNS works, apply Step 4 or Step 5 and restore the symlink from Step 2.

  7. Check Firewall Rules for Port 53

    DNS uses UDP 53, and falls back to TCP 53 for large responses. If outbound traffic on port 53 is blocked, resolution fails even with a correct configuration.

    UFW

    sudo ufw status verbose

    UFW allows outbound traffic by default. If the policy shows deny (outgoing), explicitly allow DNS:

    sudo ufw allow out 53/udp
    sudo ufw allow out 53/tcp

    iptables

    sudo iptables -L OUTPUT -n -v --line-numbers

    Look for DROP or REJECT rules matching dpt:53, or a default OUTPUT policy of DROP. To allow DNS:

    sudo iptables -I OUTPUT -p udp --dport 53 -j ACCEPT
    sudo iptables -I OUTPUT -p tcp --dport 53 -j ACCEPT

    Persist with netfilter-persistent save if you use iptables-persistent.

    nftables

    sudo nft list ruleset | grep -i -E 'output|53'

    Provider-level firewall

    Check your hosting control panel for a cloud firewall or security group. These apply before traffic reaches the VPS and won’t show up in local rules.

    Quick port-53 reachability test

    This test bypasses the local resolver and queries an upstream server directly:

    dig @1.1.1.1 google.com +short

    If that works but dig google.com doesn’t, the problem is local (systemd-resolved or resolv.conf). If both fail, something is blocking port 53, or the network itself is down.

    Can’t install dig? apt install needs DNS to work. Use the temporary fix from Step 6 first, or test with tools that ship by default:

    getent hosts google.com
    resolvectl query google.com

    Install dig later with sudo apt install bind9-dnsutils (or dnsutils on older releases).

  8. Verify /etc/nsswitch.conf

    The Name Service Switch decides the order in which the system checks sources for hostnames:

    See Also: How to Migrate Your Website from A2 Hosting to Rad Web Hosting

    grep '^hosts:' /etc/nsswitch.conf

    Expected output on Ubuntu Server:

    hosts:          files dns

    If dns is missing from the line, the system never queries DNS at all. Make sure the line contains at least files dns.

  9. Fix Local Hostname Resolution (/etc/hosts)

    A related error is:

    sudo: unable to resolve host myvps: Temporary failure in name resolution

    This means the server’s own hostname isn’t listed in /etc/hosts. Check both:

    hostname
    cat /etc/hosts

    Make sure /etc/hosts contains:

    127.0.0.1   localhost
    127.0.1.1   myvps.example.com myvps

    Replace myvps with the output of hostname. If you use an FQDN, list it first.

    On cloud images, /etc/hosts may be regenerated from a template. To make your changes stick, either set manage_etc_hosts: false in /etc/cloud/cloud.cfg, or edit /etc/cloud/templates/hosts.debian.tmpl instead.

  10. Less Common Causes

    Clock drift breaking DNSSEC

    If DNSSEC validation is enabled and the system clock is far off, signature validation fails and lookups return SERVFAIL:

    timedatectl

    If System clock synchronized: no, or the time is clearly wrong:

    sudo timedatectl set-ntp true

    Note: NTP sync by hostname also needs DNS. If DNS is completely down, set the time manually first (sudo date -s "2026-12-02 12:00:00"), fix DNS, then enable NTP.

    To rule DNSSEC out while troubleshooting, add DNSSEC=no to your resolved drop-in from Step 5 and restart systemd-resolved.

    IPv6-only or broken IPv6 resolvers

    If the only configured resolvers are IPv6 addresses but the VPS has no working IPv6 route, every query times out. Check with:

    ping -6 -c 3 2606:4700:4700::1111

    If IPv6 doesn’t work, make sure at least one IPv4 resolver is configured.

    Container-based VPS (OpenVZ / Virtuozzo / LXC)

    On container virtualization, /etc/resolv.conf is often written by the host node and replaced on every container restart. Local Netplan or systemd-resolved changes may be ignored. In this case:

    • Set the DNS servers from your hosting control panel, which updates the container config.
    • Or contact your provider to set the nameservers at the node level.

    Check your virtualization type:

    systemd-detect-virt

    Output of openvz or lxc confirms a container. kvm means full virtualization, where Steps 1–9 apply normally.

    Docker containers can’t resolve

    If the host resolves fine but containers fail, Docker may be copying 127.0.0.53 into containers, where it isn’t reachable. Set explicit DNS for the Docker daemon:

    sudo nano /etc/docker/daemon.json
    {
      "dns": ["1.1.1.1", "8.8.8.8"]
    }
    sudo systemctl restart docker

    Upstream resolver outage

    If the configured resolvers are reachable but return nothing, the provider’s resolver may be down. Switch temporarily to a public resolver to confirm:

    See Also: How to Install DNSControl on Ubuntu VPS to Manage PowerDNS

    Provider IPv4 IPv6
    Cloudflare 1.1.1.1, 1.0.0.1 2606:4700:4700::1111
    Google 8.8.8.8, 8.8.4.4 2001:4860:4860::8888
    Quad9 9.9.9.9, 149.112.112.112 2620:fe::fe

    Configuring resolvers from two different providers protects you against a single provider’s outage.

Troubleshooting Reference Table

Symptom Likely cause Fix
IP ping works, hostname fails DNS misconfiguration Steps 2–5
/etc/resolv.conf missing or broken symlink File deleted or overwritten Step 2
resolvectl status shows no DNS servers No nameservers in Netplan / DHCP Step 4 or 5
systemd-resolved won’t start Port 53 conflict Step 3
Fix works, then breaks after reboot cloud-init or host node overwriting config Step 4 (cloud-init) / Step 10 (containers)
dig @1.1.1.1 fails too Firewall blocking port 53, or no network Steps 1, 7
sudo: unable to resolve host Hostname missing from /etc/hosts Step 9
SERVFAIL on valid domains DNSSEC + clock drift Step 10
Host resolves, Docker containers don’t Stub resolver unreachable from containers Step 10

One-Shot Diagnostic Script

Save this as dns-diag.sh and run it with sudo bash dns-diag.sh to collect everything above in one pass:

#!/usr/bin/env bash
# dns-diag.sh - Diagnose "Temporary failure in name resolution" on Ubuntu

set -u
TEST_HOST="google.com"
TEST_IP="1.1.1.1"

hr() { printf '\n==== %s ====\n' "$1"; }

hr "Virtualization"
systemd-detect-virt 2>/dev/null || echo "unknown"

hr "Interfaces / default route"
ip -br addr
ip route show default || echo "NO DEFAULT ROUTE"

hr "Raw connectivity (${TEST_IP})"
if ping -c 2 -W 2 "$TEST_IP" >/dev/null 2>&1; then
  echo "OK: network reachable"
else
  echo "FAIL: cannot reach ${TEST_IP} - this is a network issue, not DNS"
fi

hr "/etc/resolv.conf"
ls -l /etc/resolv.conf
lsattr /etc/resolv.conf 2>/dev/null
cat /etc/resolv.conf 2>/dev/null || echo "MISSING or BROKEN SYMLINK"

hr "systemd-resolved"
systemctl is-active systemd-resolved
resolvectl status 2>/dev/null | grep -E 'Link|Current DNS|DNS Servers|DNSSEC'

hr "Port 53 listeners"
ss -lntup 2>/dev/null | grep ':53 ' || echo "none"

hr "nsswitch hosts line"
grep '^hosts:' /etc/nsswitch.conf

hr "Hostname / /etc/hosts"
echo "hostname: $(hostname)"
grep -E "127\.0\.1\.1|$(hostname)" /etc/hosts || echo "WARN: hostname not in /etc/hosts"

hr "Clock"
timedatectl | grep -E 'Local time|synchronized'

hr "Firewall"
command -v ufw >/dev/null && ufw status verbose | grep -E 'Status|Default'
iptables -S OUTPUT 2>/dev/null | grep -E 'DROP|REJECT|-P OUTPUT' || true

hr "Resolution tests"
echo -n "getent (system resolver): "
getent hosts "$TEST_HOST" >/dev/null && echo OK || echo FAIL
echo -n "resolvectl query:         "
resolvectl query "$TEST_HOST" >/dev/null 2>&1 && echo OK || echo FAIL
if command -v dig >/dev/null; then
  echo -n "dig @1.1.1.1 (direct):    "
  [ -n "$(dig +short +time=2 @1.1.1.1 "$TEST_HOST")" ] && echo OK || echo FAIL
fi

Reading the results:

See Also: How to Install Pleroma on Ubuntu VPS (5 Minute Quick-Start Guide)

  • getent FAIL + dig @1.1.1.1 OK: the local resolver config is the problem (Steps 2–5).
  • Both FAIL while the raw ping is OK: port 53 is blocked (Step 7).
  • Raw ping FAIL: it’s a network issue, not DNS.

Summary

  1. Confirm the problem is DNS by pinging an IP and then a hostname.
  2. Restore /etc/resolv.conf as a symlink to stub-resolv.conf.
  3. Make sure systemd-resolved is running and has upstream servers.
  4. Define nameservers permanently in Netplan, and disable cloud-init network management if needed.
  5. Add global fallback DNS through a resolved.conf.d drop-in.
  6. Verify the firewall allows outbound UDP/TCP 53.
  7. Check /etc/hosts, nsswitch.conf, clock sync, and container/Docker cases.

For most VPS instances, the fix is Step 4 (nameservers in Netplan) plus Step 2 (restoring the symlink).

Launch 100% ssd ubuntu vps from $3. 19/mo!

Conclusion

You now know how to resolve “Temporary Failure in Name Resolution” on Ubuntu VPS.


Compare Ubuntu VPS Plans

KVM-SSD-1
KVM-SSD-8
KVM-SSD-16
KVM-SSD-32
CPU
1 Core
2 Cores
4 Cores
8 Cores
Memory
1 GB
8 GB
16 GB
32 GB
Storage
16 GB NVMe
128 GB NVMe
256 GB NVMe
512 GB NVMe
Bandwidth
1 TB
4 TB
8 TB
16 TB
Network
1 Gbps
1 Gbps
1 Gbps
1 Gbps
Delivery Time
⏱️ Instant
⏱️ Instant
⏱️ Instant
⏱️ Instant
Location
US/EU/APAC
US/EU/APAC
US/EU/APAC
US/EU/APAC
Price
$7.58*
$39.50*
$79.40*
$151.22*
KVM-SSD-1
$7.58*
CPU 1 Core
Memory 1 GB
Storage 16 GB NVMe
Bandwidth 1 TB
Network 1 Gbps
Delivery Time ⏱️ Instant
Location US/EU/APAC
KVM-SSD-8
$39.50*
CPU 2 Cores
Memory 8 GB
Storage 128 GB NVMe
Bandwidth 4 TB
Network 1 Gbps
Delivery Time ⏱️ Instant
Location US/EU/APAC
KVM-SSD-16
$79.40*
CPU 4 Cores
Memory 16 GB
Storage 256 GB NVMe
Bandwidth 8 TB
Network 1 Gbps
Delivery Time ⏱️ Instant
Location US/EU/APAC
KVM-SSD-32
$151.22*
CPU 8 Cores
Memory 32 GB
Storage 512 GB NVMe
Bandwidth 16 TB
Network 1 Gbps
Delivery Time ⏱️ Instant
Location US/EU/APAC

(function () {
// Add header bar with language label + copy button to every code block
document.querySelectorAll(‘.code-block’).forEach(function (block) {
var lang = block.getAttribute(‘data-lang’) || ‘code’;
var header = document.createElement(‘div’);
header.className = ‘code-header’;

var label = document.createElement(‘span’);
label.textContent = lang;

var btn = document.createElement(‘button’);
btn.className = ‘copy-btn’;
btn.type = ‘button’;
btn.textContent = ‘Copy’;
btn.addEventListener(‘click’, function () {
var text = block.querySelector(‘code’).innerText;
var done = function () {
btn.textContent = ‘Copied’;
btn.classList.add(‘copied’);
setTimeout(function () {
btn.textContent = ‘Copy’;
btn.classList.remove(‘copied’);
}, 1600);
};
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(text).then(done).catch(fallback);
} else {
fallback();
}
function fallback() {
var ta = document.createElement(‘textarea’);
ta.value = text;
ta.style.position = ‘fixed’;
ta.style.opacity = ‘0’;
document.body.appendChild(ta);
ta.select();
try { document.execCommand(‘copy’); done(); } catch (e) {}
document.body.removeChild(ta);
}
});

header.appendChild(label);
header.appendChild(btn);
block.insertBefore(header, block.firstChild);

See Also: 6 Ways to Customize the VPS Panel With Your Branding – Cloud Admin Guide

// Dim full-line comments in bash/ini/yaml blocks
if ([‘bash’, ‘ini’, ‘yaml’].indexOf(lang) !== -1) {
var code = block.querySelector(‘code’);
code.innerHTML = code.innerHTML
.split(‘\n’)
.map(function (line) {
return /^\s*#/.test(line) ? ‘‘ + line + ‘‘ : line;
})
.join(‘\n’);
}
});
})();

Avatar of editorial staff

Editorial Staff

Rad Web Hosting is a leading provider of web hosting, Cloud VPS, and Dedicated Servers in Dallas, TX.

Leave a Reply

lg