sudo: unable to resolve host

Avatar forum:Boomfelled 4 years, 11 months ago

Hello,

I'm setting up my linode and securing my server using the following documentation: https://library.linode.com/securing-your-server

On executing the following command:

sudo chmod +x /etc/network/if-pre-up.d/firewall 

I'm receiving this message:

sudo: unable to resolve host amidala

Any help would be appreciated.

6 Replies

Is 'amidala' a reference to your Linode? Please provide the output from the following two commands: cat /etc/hostname cat /etc/hosts

Many thanks for replying.

alan@amidala:~$ cat /etc/hostname
amidala
alan@amidala:~$ cat /etc/hosts
127.0.0.1    localhost
127.0.1.1    ubuntu

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Thanks again

Boomfelled,

You don't have any reference to 'amidala' in your hosts file. That's why it's not resolving. You may have missed this:

https://library.linode.com/getting-star … -etc-hosts">https://library.linode.com/getting-started#sph_update-etc-hosts

Great, that's fixed it, I must have missed that somehow.

Thanks again for your help. :-)

mine is showing this
root@agriloan:~# cat /etc/hostname
agriloan
root@agriloan:~# cat /etc/hosts
127.0.0.1 localhost

The following lines are desirable for IPv6 capable hosts

::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct