Posts: 347
Silent Observer
Joined: 08 Aug 2013
#1
Everything I do with my laptop (Gateway Solo 2500, PII 300 MHz, 288 MiB RAM, antiX 13.2 32-bit Full Testing, fully updated as of yesterday) that should display a hostname (such as the default prompt in bash) shows either"none" or"(none)" -- so, in a fresh terminal, I get this prompt:

Code: Select all

user@(none):~
$
. The same thing appears in System Information when started from Control Centre. Multiple attempts to change the computer name with System Configuration report as successful and read back the correct entry in the yad window, but nothing changes when something else tries to report the hostname. Different hostnames (replacing a space with underscore, and making the name shorter than 8 characters) change nothing.

I don't have this problem on my Athlon XP 2000+ desktop machine, running the same version of antiX (albeit with a number of additional packages installed and significantly different hardware). Suggestions?
Posts: 1,308
BitJam
Joined: 31 Aug 2009
#2
To check the hostname from the command line run:

Code: Select all

hostname
Also look at the contents of / etc/hostname:

Code: Select all

cat / etc/hostname
To set the hostname from the command line:

Code: Select all

 echo HHHH | sudo tee / etc/hostname
sudo hostname -F / etc/hostname
where HHHH is the new hostname.

Remove the space between"/" and"etc". It is put there to avoid triggering a stupid bug in the forum software.
Posts: 347
Silent Observer
Joined: 08 Aug 2013
#3
Yep, checked the etc/hostname file, it's got the correct contents (plain text, exactly what I entered from the System Configuration tool in Control Centre). Despite that, hostname returns (none).

I tried setting hostname from command line; as su:

Code: Select all

echo Little_Luddite > [/]etc/hostname
gave no error message, but

Code: Select all

hostname -F [/]etc/hostname
returned"specified hostname is invalid".

The same sequence using"Elder1" for the hostname worked, and starting a new terminal had the correct hostname in the prompt. Is there an 8-character limit on hostname? Also, is there a bug in the GUI System Configuration (and in the installer) that fails to check if the new requested hostname is valid? And a (possibly separate) bug in System Configuration that will fail to set if the existing name is invalid?
Posts: 1,308
BitJam
Joined: 31 Aug 2009
#4
Underscores are not valid characters in
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://en.wikipedia.org/wiki/Domain_name"
linktext was:"domain names"
====================================
. You can only use letters, numerals, and the"-" sign but it can't start or end with a"-" sign.
Posts: 347
Silent Observer
Joined: 08 Aug 2013
#5
__{{emoticon}}__ Now, see, it never would have occurred to me to look for domain name rules for host names...