Can't set hostname - Ubuntu

I've had an Ubuntu machine up & running (with Virtualmin too) for about 4 months and recently needed to reboot (due to the updates Linode is doing). Upon coming back online I noticed some services down, mail & whatnot…

They're complaining that the hostname is invalid. I checked all the settings & whatnot. It's all fine. But the hostname is stuck as "(none)" - Nothing I can do to set the hostname works. Naturally I double checked the docs and whatnot. I've been a sysadmin for a long time so I should be able to manage this.

But nothing works! Anyone have any ideas?

Here's the prompt and result from the hostname command:

root@(none):/var/log# hostname

serverX.XXXYY.com

You can see the hostname in the prompt… But the hostname (redacted) command gives the right name.

2 Replies

> But nothing works! Anyone have any ideas?
You say nothing works, but we don't know what you tried to do.

What did you actually try?

Did you get errors when tried it?

Helps sometimes when you don't redact the info to see exactly what is being output.

In writing a reply to cover everything over again from start to finish it reminded me of a bug. One that cropped up right about when that server was set up.

I used a manual fix to get me through & forgot that was the one that needed to be updated, which it was. So with the fix in place it was acting up.

Thanks for making me run through the info again! Everything's great.

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