You are not logged in.

#1 2012-08-18 02:10:24

handy
Member
From: Oz
Registered: 2008-03-26
Posts: 719

[SOLVED] Hostname: Thisfiletakesprecedenceoveretchostswhere

Some days ago I converted Arch to pure Systemd, which is a great system imho.

One lingering problem is that my /etc/hostname file (which has the same hostname as /etc/hosts is not effective?

I get the following:

handy ~  $  hostname
Thisfiletakesprecedenceoveretchostswhere

I have searched & can't find any information on this.

In /etc/hostname I have tried using each of the following to no avail:

righpc
"rightpc"
HOSTNAME="rightpc"
HOSTNAME=rightpc

Any ideas?

Last edited by handy (2012-08-18 09:52:04)


I used to be surprised that I was still surprised by my own stupidity, finding it strangely refreshing.
Well, now I don't find it refreshing.
I'm over it!

Offline

#2 2012-08-18 06:55:54

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: [SOLVED] Hostname: Thisfiletakesprecedenceoveretchostswhere

$  hostname
Archer
$ cat /etc/hostname
Archer

Can you post the contents of you /etc/hostname and /etc/hosts please.


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#3 2012-08-18 08:26:02

handy
Member
From: Oz
Registered: 2008-03-26
Posts: 719

Re: [SOLVED] Hostname: Thisfiletakesprecedenceoveretchostswhere

Thanks for your reply.

/etc/hostname :

handy ~  $  hostname
Thisfiletakesprecedenceoveretchostswhere
handy ~  $  cat /etc/hostname
# This file takes precedence over /etc/hosts where
# the hostname must also be included:

rightpc 

/etc/hosts :

#
# /etc/hosts: static lookup table for host names
#

#<ip-address>		<hostname.domain.org>	<hostname>

127.0.0.1		localhost.localdomain	localhost rightpc

#192.168.1.2		rightpc.localdomain	rightpc		## the HP server
#192.168.1.3		leftpc.localdomain	leftpc 		## the iMac client


# End of file

I used to be surprised that I was still surprised by my own stupidity, finding it strangely refreshing.
Well, now I don't find it refreshing.
I'm over it!

Offline

#4 2012-08-18 09:39:35

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Hostname: Thisfiletakesprecedenceoveretchostswhere

Follow loafer's example and remove everything from /etc/hostname except the machine hostname...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2012-08-18 09:51:36

handy
Member
From: Oz
Registered: 2008-03-26
Posts: 719

Re: [SOLVED] Hostname: Thisfiletakesprecedenceoveretchostswhere

Thanks, that fixed it.

I can't believe that I didn't see that... <hangs his head in shame>


I used to be surprised that I was still surprised by my own stupidity, finding it strangely refreshing.
Well, now I don't find it refreshing.
I'm over it!

Offline

Board footer

Powered by FluxBB