Skip links
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.

ALSO READ  Migrating WordPress Website To Lightsail On AWS - Part 2
Share This Article:
Facebook
Twitter
LinkedIn
Pinterest
WhatsApp
Email
Reddit
Related Articles:
Rearranging Wordpress Editor
Tips
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 »
feature snippets complete guide
Search Engine Optimization (SEO)
A Beginner’s Guide To Google Featured Snippets

Did you know that Google already has the answer to your customer’s question? You’re probably thinking that you can outrank Google because it’s something they don’t have, but I would think again. Why? Because the answer is staring right at you in the search results. More and more websites are

Read More »
Subscribe to our newsletter
[newsletter_signup_form id=1]
Chat With Our SEO community members On discord

Leave a comment

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.

  1. Helped me clear this error on my localhost server.

    Thanks.

Explore
Drag