sudo: unable to resolve host

AWS error – sudo: unable to resolve host ip-xx-xx-xx-xx: Temporary failure in name resolution

Table of Contents

Ever faced with an error like this? is a very common error in Linux systems.

Here’s how you can solve it.

Step 1: Log into the system as the root user.

Step 2: Two things need to be checked. Let’s assume that the machine name is machine1.

The first thing to be checked here is if the entry in the hostname file of the machine is correct.

This can be checked with the following command:

sudo nano /etc/hostname

If the machine name machine1 is not there in this file, enter it here.

Step 3: Check the .

The file /etc/hosts is usually the commonplace missing the machine name in most of the cases. Open and check this file if the machine1 is entered hereafter the line.

sudo nano /etc/hosts

The final file should look something like this:

127.0.0.1    localhost.localdomain localhost  
127.0.1.1    machine1

The hostname will not change until you reboot. So if you have made any changes as said above, restart the system with this command.

sudo systemctl restart

This should remove the error finally.

Share This Article:
Facebook
Twitter
LinkedIn
Pinterest
WhatsApp
Email
Reddit
Related Articles:
Cheap-Domain-Names-Registration
Domains
Find The Cheapest Domain Registration For Your Next Domain

Domain registrars are organizations that administer and register domain names for international websites. The value of choosing the right domain cannot be overstated, as it can deceive a consumer in a variety of ways. You may also use it to register and buy a domain name. Many of these registrars

Read More »
site migration seo
Search Engine Optimization (SEO)
Best Guide For Site Migration SEO And Checklist

Migrating a website, particularly when it comes to SEO, isn’t a simple approach that can be slapped together in an afternoon or a day or two before launch. To ensure that your post-launch site retains and generates as much organic visibility as possible, an SEO migration needs extensive study, planning,

Read More »
guide-to-converting-wordpress-sites-to-static-html1
WordPress
How To Convert WordPress Website To A Static Website

Most websites were static once upon a time when the internet was young and items like fake news, social media bubbles, and nasty comments were years away from being widespread. However, things changed, and dynamic websites became the rage. Personalization, commenting, and other forms of interactivity that were not possible

Read More »
Subscribe to our newsletter
Chat With Our SEO community members On discord

One Response

Leave a Reply

Your email address will not be published.

This site uses User Verification plugin to reduce spam. See how your comment data is processed.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: