LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   hostname: Unknown host (https://www.linuxquestions.org/questions/linux-newbie-8/hostname-unknown-host-824819/)

konzo 08-07-2010 02:00 PM

hostname: Unknown host
 
I changed my hostname with the hostname command and check it in /etc/hostname. It is all correct. The name is set. After that I restarted the script
Code:

/etc/init.d/hostname.sh start
The problem is that on my next login when I type
hostname -s or
hostname -a

hostname: Unknown host

appear. What am I missing? I use Debian 5.05

rsciw 08-07-2010 02:20 PM

What's the output of
cat /etc/hosts
cat /etc/hostname

konzo 08-07-2010 02:23 PM

here is the output
Code:

kodeserver:~# cat /etc/hosts
127.0.0.1      localhost
xxx.xx.xx.xxx    kodeserver.kdelchev.com kodeserver

# The following lines are desirable for IPv6 capable hosts
::1    localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
kodeserver:~# cat /etc/hostname
kodeserver


rsciw 08-07-2010 02:38 PM

Some folks on the net suggest to add a FQDN to /etc/hosts

try adding
localhost.lan or something similar next to localhost and see what happens.

Otherwise I'm at a loss too, hasn't happened to me yet

konzo 08-07-2010 02:43 PM

Seems the restarting solve the problem. (win experience matters ;) )
now telnet localhost 25 shows the new host and domain name.

Thank you for the quick reply.


All times are GMT -5. The time now is 12:39 PM.