Re: Changing Hostname?
Hi.
On Sat, 21 Dec 2013 22:32:06 -0500
Jon N <jdnandroid@gmail.com> wrote:
> It does return the new hostname. But, I started wondering about legal
> characters. If you remember my old one was 'localhost-01' but in my
> new one I used an underscore (_). According to
> netregister.biz/faqit.htm no symbols are usable except the hyphen (-).
> No accented characters either. So I changed the name again and
> rebooted once more. This time everything started just fine.
You're citing wrong page. Right one is RFC 952, ASSUMPTIONS chapter.
http://tools.ietf.org/search/rfc952
Not empty, but if it contains illegal characters it won't make any
> difference. I didn't find any error messages that would clue me in to
> the problem (like: "Warning, you have illegal characters in your
> hostname" :-)). I did notice on one boot an error message that
> 'hostname.sh' (in /etc/init.d) had failed, but I searched all my log
> files and could not find any reference to it at all. I guess not
> everything you see on screen during boot makes it into one of the log
> files.
Should be there.
# echo FOO_BAR > /etc/hostname
# /etc/init.d/hostname.sh start
hostname: the specified hostname is invalid
Still, the kernel itself allows one to shoot in the foot:
# sysctl -w kernel.hostname=FOO_BAR
kernel.hostname = FOO_BAR
# hostname
FOO_BAR
Reco
Reply to: