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 localhost 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:
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on pinterest
Pinterest
Share on whatsapp
WhatsApp
Share on email
Email
Share on reddit
Reddit
Related Articles:
Rearranging Wordpress Editor
WordPress
How to Reorganize the Post Editing Screen in WordPress

When it comes to content creation, WordPress is widely regarded as one of the most versatile and user-friendly CMS platforms available. Indeed, this is one of the reasons why so many well-known brands depend on WordPress to run their websites. Now, when it comes to the WordPress content editing system,

Read More »
migrate wordpress to aws
Linux
Migrating WordPress Website To Lightsail On AWS – Part 2

In the previous post of this series, we have learned how to set up the AWS Lightsail servers to be ready for the WordPress website. If you haven’t read this post yet, we highly recommend you give it a read here: https://underwp.com/migrating-wordpress-website-to-lightsail-on-aws-part-1/ So far we have set up the server

Read More »
promote freelancer gig free on linkedin
LinkedIn
Promote Your Freelancer Services On LinkedIn For Free

After a beta launch earlier this year for limited users, LinkedIn Marketplace is now open for all. Professionals can now opt into it and promote their services as freelancers for free. The potential reach of LinkedIn in the professional world is much higher than any other social media network. With

Read More »
No Nonsense. Just Really Good Marketing Insights

Sign up to get free weekly resources.

One Response

Leave a Reply

Your email address will not be published. Required fields are marked *

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

%d bloggers like this: