sudo: unable to resolve host Dell-Inspiron-3421 in Ubuntu

I was changing the hostname in Ubuntu 13.10 but after changing the hostname i got this error: “sudo:unable to resolve host Sudeep-Inspiron-3421”.

I got this error because we need to have same hostname in both the file(hosts and hostname). To fix this error type the following in the Terminal to open the file and write the same hostname in both the files (hosts and hostname).

sudo gedit /etc/hosts/

In this file generally the hostname in written in the second line. You will see the first two line similar to this:
127.0.0.1 localhost
127.0.1.1 Dell-Inspiron-3421

Next enter this in the terminal and write the same hostname written in previous file.

sudo /etc/hostname

Now restart your computer and you will not get the error.

One thought on “sudo: unable to resolve host Dell-Inspiron-3421 in Ubuntu”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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