When running apt-get update
on your Ubuntu 11.04 VPS, you're encountering DNS resolution failures for Ubuntu's package repositories. The key symptoms are:
Err http://archive.ubuntu.com natty Release.gpg
Temporary failure resolving 'archive.ubuntu.com'
Your ping test to 8.8.8.8 succeeds, confirming basic network connectivity:
64 bytes from 8.8.8.8: icmp_req=1 ttl=56 time=13.3 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=56 time=13.2 ms
However, the /etc/resolv.conf
shows only one nameserver:
nameserver 199.193.248.1
Let's verify DNS functionality with nslookup
or dig
:
nslookup archive.ubuntu.com
# OR
dig archive.ubuntu.com
If these fail, we've confirmed DNS is the root cause.
1. Update Nameserver Configuration
Edit /etc/resolv.conf
to include reliable DNS servers:
nameserver 8.8.8.8 # Google Primary
nameserver 8.8.4.4 # Google Secondary
nameserver 199.193.248.1 # Existing server
2. Verify DNS Cache (if using systemd-resolved)
For newer Ubuntu versions:
sudo systemd-resolve --flush-caches
sudo systemd-resolve --statistics
3. Alternative: Static Hosts Entry
As a temporary measure, add repository IPs to /etc/hosts
:
91.189.91.38 archive.ubuntu.com
91.189.91.39 security.ubuntu.com
Checking DNS Resolution Path
Use traceroute
to identify network bottlenecks:
traceroute archive.ubuntu.com
Testing Alternative Repositories
Temporarily switch to a mirror:
sudo sed -i 's/archive.ubuntu.com/mirrors.digitalocean.com/g' /etc/apt/sources.list
After making changes, test with:
ping -c 4 archive.ubuntu.com
nslookup security.ubuntu.com
apt-get update
When your Ubuntu VPS fails to resolve package repositories like archive.ubuntu.com, the first step is to verify your DNS configuration. The error suggests your system can't translate domain names to IP addresses.
# Test basic connectivity
ping -c 4 8.8.8.8
# Check DNS resolution
nslookup archive.ubuntu.com
dig archive.ubuntu.com
Your /etc/resolv.conf shows only one nameserver. For reliable resolution, add multiple public DNS servers:
# Edit resolv.conf
nano /etc/resolv.conf
# Replace with these entries:
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 1.1.1.1
nameserver 208.67.222.222
On modern Ubuntu systems, resolv.conf may be managed by NetworkManager. Try this instead:
# Install network manager if needed
apt-get install network-manager
# Configure DNS via nmcli
nmcli con mod eth0 ipv4.dns "8.8.8.8 8.8.4.4"
nmcli con up eth0
After making DNS changes, verify resolution works:
# Clear DNS cache
systemd-resolve --flush-caches
# Test repository access
apt-get update
apt-get install -y dnsutils
To prevent DNS settings from resetting after reboot:
# For systems using netplan
nano /etc/netplan/01-netcfg.yaml
# Add nameservers under the interface configuration
If DNS remains problematic, you can temporarily use repository IP addresses:
# Edit sources.list to use IPs
deb http://91.189.88.152/ubuntu natty main
deb http://91.189.88.152/ubuntu natty-updates main
Remember this is not a permanent solution as repository IPs may change.
Some VPS providers block certain DNS ports. Test with:
# Check DNS port 53
telnet 8.8.8.8 53
# Check HTTP ports
telnet archive.ubuntu.com 80