Skip to content

Sudden DNS resolution error in Ubuntu - Unable to ping any external site

0

Hello All, Since last 2 days, I get this error in my Lighsail instance(Ubuntu 22.x) everytime I do a SSH to this instance. This was not happenning since 2 weeks, the instance was running fine serving my websites. Now any ping e.g. "ping google.com" is also not working also the website ending up in 522 error.

Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings

This is blocking everything else as end user also not able to reach the site hosted in this VPS.

What might have happened since last 2 days? Has anyone found a fix?

1 Answer
1

The sudden DNS resolution error you're experiencing on your Lightsail Ubuntu instance could be caused by several factors. Since this issue started occurring recently after a period of normal operation, it's likely that there's been a change in your DNS configuration or network settings.

Here are some potential causes and steps to troubleshoot:

  1. DNS Server Issues: Check if the DNS servers configured on your instance are correct and responsive. You can verify this by looking at the /etc/resolv.conf file.
  2. Network Configuration: Ensure that your instance's network settings allow outbound DNS (port 53) and HTTP/HTTPS traffic.
  3. Local DNS Cache: Try flushing your local DNS cache to ensure you're not relying on outdated information. Newer Ubuntus: sudo resolvectl flush-caches or maybe sudo systemd-resolve --flush-caches (on older Ubuntus)
  4. Nameserver Configuration: Check if your domain's nameservers are correctly set up and functioning.

To troubleshoot, you can try the following:

  1. Use the dig +trace command to perform a recursive DNS lookup and identify where the resolution process fails.
  2. Try using a specific DNS resolver by running 'nslookup domain_name 8.8.8.8' (using Google's DNS as an example).
  3. Verify that you can reach IP addresses directly (e.g., ping 8.8.8.8) to confirm basic network connectivity.
  4. Check if systemd-resolved is running and configured correctly.
  5. Ensure that your /etc/hosts file doesn't contain any conflicting entries.

If these steps don't resolve the issue, you may need to reconfigure your network settings or contact AWS support for further assistance. It's also possible that there have been changes to the Ubuntu repositories or security updates that are affecting DNS resolution, so checking for any recent system updates or changes might provide additional clues.

Remember to backup your configuration files before making any changes, and consider the potential impact on your hosted websites when troubleshooting.

Sources
Troubleshoot website access errors on Lightsail | AWS re:Post
Unable to Resolve DNS and Access Internet on EC2 Instance | AWS re:Post

answered a year ago
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.