You are not logged in.

#1 2011-12-03 15:43:46

zyxon
Member
From: Hungary
Registered: 2010-08-31
Posts: 36
Website

Cannot set hostname

Hello, recently I moved to a different place, and changed my ISP aswell. Now I'm using the router provided by my new ISP. My problem is, that unlike with the previous ISP the hostname specified in the rc.conf file isn't set correctly.
The corresponding part of my rc.conf:

# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="skynet"

[...]

interface=eth0
address=
netmask=
broadcast=
gateway=

I've been suggested to add the hostname to /etc/hosts. It didn't work. My /etc/hosts:

[zyxon@dhcppc0 ~]$ cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#

#<ip-address>	<hostname.domain.org>	<hostname>
127.0.0.1	localhost.localdomain	localhost myhost
127.0.0.1	localhost.localdomain	skynet 
127.0.0.1	skynet.localdomain	localhost skynet 
::1		localhost.localdomain	localhost

# End of file

And the hostname is dhcppcN insted of skynet. How can I use the hostname skynet again?

Offline

#2 2011-12-03 15:52:52

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: Cannot set hostname

Instead of

127.0.0.1	localhost.localdomain	localhost myhost
127.0.0.1	localhost.localdomain	skynet 
127.0.0.1	skynet.localdomain	localhost skynet 

use

127.0.0.1	localhost.localdomain	localhost skynet 

:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#3 2011-12-03 16:46:52

zyxon
Member
From: Hungary
Registered: 2010-08-31
Posts: 36
Website

Re: Cannot set hostname

bohoomil wrote:

Instead of

127.0.0.1	localhost.localdomain	localhost myhost
127.0.0.1	localhost.localdomain	skynet 
127.0.0.1	skynet.localdomain	localhost skynet 

use

127.0.0.1	localhost.localdomain	localhost skynet 

Thanks for the reply. Still doesn't work.

[zyxon@dhcppc0 ~]$ cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#

#<ip-address>	<hostname.domain.org>	<hostname>
127.0.0.1	localhost.localdomain	localhost skynet
::1		localhost.localdomain	localhost

# End of file

Offline

#4 2011-12-03 17:26:25

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: Cannot set hostname

What output do you get when you type

hostname

in a terminal?

And what's inside your /etc/conf.d/dhcpcd file?


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#5 2011-12-03 21:27:59

zyxon
Member
From: Hungary
Registered: 2010-08-31
Posts: 36
Website

Re: Cannot set hostname

bohoomil wrote:

What output do you get when you type

hostname

in a terminal?

And what's inside your /etc/conf.d/dhcpcd file?

Hostname gives "command not found" message.

[zyxon@dhcppc0 ~]$ hostname
bash: hostname: parancs nem található

I have an unedited dhcpcd config file:

[zyxon@dhcppc0 ~]$ cat /etc/conf.d/dhcpcd 
#
# Arguments to be passed to the DHCP client daemon
#

DHCPCD_ARGS="-q"

Last edited by zyxon (2011-12-03 21:28:27)

Offline

#6 2011-12-03 21:47:38

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Re: Cannot set hostname

zyxon wrote:

Hostname gives "command not found" message.

http://www.archlinux.org/news/hostname- … inetutils/

Offline

#7 2011-12-03 21:51:49

b4data
Member
Registered: 2010-12-14
Posts: 141

Re: Cannot set hostname

Hostname gives "command not found" message.

hostname is provided by inetutils in [core]

Offline

#8 2011-12-03 22:00:50

zyxon
Member
From: Hungary
Registered: 2010-08-31
Posts: 36
Website

Re: Cannot set hostname

Thanks Lars Stokholm and b4data. Output of hostname is:

[zyxon@dhcppc0 ~]$ hostname 
dhcppc0

Offline

#9 2011-12-04 02:11:11

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: Cannot set hostname

Take a look at this, the case seems identical. Try modifying dhcpcd.conf the same way, ie. by removing 'host_name', so the line looks like 'option domain_name_servers, domain_name, domain_search'.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#10 2011-12-04 08:19:54

zyxon
Member
From: Hungary
Registered: 2010-08-31
Posts: 36
Website

Re: Cannot set hostname

Wow, seemingly without reason today morning my machine booted with skynet as its hostname. thanks for your effor guys! smile

Offline

Board footer

Powered by FluxBB