Change localhost - Mandriva
This is a discussion on Change localhost - Mandriva ; I understood that 'localhost' wa synominous wuth 127.0.0.1 and that running
#hostname could change it. I have tried changing the line giving
127.0.0.1 - localhost in
/etc/netprofile/profiles/defaults/files/etc/hosts
to 127.0.0.1 -
I have also tried adding HOSTNAME= to
/etc/sysconfig/network
But when ...
-
Change localhost
I understood that 'localhost' wa synominous wuth 127.0.0.1 and that running
#hostname could change it. I have tried changing the line giving
127.0.0.1 - localhost in
/etc/netprofile/profiles/defaults/files/etc/hosts
to 127.0.0.1 -
I have also tried adding HOSTNAME= to
/etc/sysconfig/network
But when I try http://:631/ for cups nothing is returned. Anybody
know the answer? The distro version is 2007.0.0.1
-
Re: Change localhost
On Sun, 29 Jul 2007 17:43:09 +0100, Alan Secker wrote:
> I understood that 'localhost' wa synominous wuth 127.0.0.1 and that running
> #hostname could change it. I have tried changing the line giving
> 127.0.0.1 - localhost in
> /etc/netprofile/profiles/defaults/files/etc/hosts
> to 127.0.0.1 -
>
> I have also tried adding HOSTNAME= to
> /etc/sysconfig/network
>
> But when I try http://:631/ for cups nothing is returned. Anybody
> know the answer? The distro version is 2007.0.0.1
Localhost IP is always 127.0.0.1. It's whats assigned to device lo on
boot. Hostname changes device eth0. Be warned It wouldn't be a good idea
to change the localhost name or IP address but if you really want to screw
your system up you can change the address in ifcfg-lo.
--
Want the ultimate in free OTA SD/HDTV Recorder? http://mythtv.org
http://mysettopbox.tv/knoppmyth.html Usenet alt.video.ptv.mythtv
My server http://wesnewell.no-ip.com/cpu.php
HD Tivo S3 compared http://wesnewell.no-ip.com/mythtivo.htm
-
Re: Change localhost
On Sun, 29 Jul 2007 17:43:09 +0100, Alan Secker wrote:
> I understood that 'localhost' wa synominous wuth 127.0.0.1 and that running
> #hostname could change it.
By the way, changing hostname on a running system may give some
applications fits. Desktop manager comes to mind.
> I have tried changing the line giving
> 127.0.0.1 - localhost in
> /etc/netprofile/profiles/defaults/files/etc/hosts
> to 127.0.0.1 -
No need for that, put it back like you found it
I also would like for you to do a
rm /etc/hostname
> I have also tried adding HOSTNAME= to
> /etc/sysconfig/network
That is the file the system uses during boot to normally set the host name.
> But when I try http://:631/ for cups nothing is returned. Anybody
> know the answer? The distro version is 2007.0.0.1
No, idea what release you are running. Looking on my system
$ cat /etc/release
Mandriva Linux release 2007.1 (Official) for i586
Here are my recommendations for hostname.
$ cat /etc/sysconfig/network
NETWORKING_IPV6=no
NOZEROCONF=yes
GATEWAYDEV=eth0
GATEWAY=192.168.2.1
HOSTNAME=wb.home.invalid <====== sets FQDN hostname on boot
NEEDHOSTNAME=no <====== add this line just for fun
NETWORKING=yes
$ cat /etc/hosts
127.0.0.1 localhost
192.168.2.1 fw.home.invalid fw
192.168.2.12 wb1.home.invalid wb1
192.168.2.30 wb.home.invalid wb <===== ties ip addy to hostname
192.168.2.60 scsi.home.invalid scsi
Next reboot should set hostname based on /etc/sysconfig/network
Do check name and ip resolution as follows:
$ ping -c 1 $(hostname -s)
.------ Your FQDN host name
| .---------- ip address
V V
PING wb.home.invalid (192.168.2.30) 56(84) bytes of data.
64 bytes from wb.home.invalid (192.168.2.30): icmp_seq=1 ttl=64 time=0.024 ms
--- wb.home.invalid ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.024/0.024/0.024/0.000 ms
-
Re: Change localhost
Alan Secker wrote:
> I understood that 'localhost' wa synominous wuth 127.0.0.1 and that
> running
> #hostname could change it. I have tried changing the line giving
> 127.0.0.1 - localhost in
> /etc/netprofile/profiles/defaults/files/etc/hosts
> to 127.0.0.1 -
>
> I have also tried adding HOSTNAME= to
> /etc/sysconfig/network
>
> But when I try http://:631/ for cups nothing is returned. Anybody
> know the answer? The distro version is 2007.0.0.1
What I do is to go to MCC, then Networking/Ethernet.
In the line "Assign hostname from DHCP" uncheck the box and change that to
the hostname you want. That will change /etc/hosts to "newname"
localhost.localdomain localhost in some sequence. You can still use
localhost, but your new name will be the one visible. I still use
localhost for MySQL and for the address of my Apache host, which is purely
local.
If running hostname does work at all, it probably won't survive
the session.
In Debian, it seems to be that changing /etc/hosts is all that you need to
do. Debian-based systems insist as well during setup that you have a one
word hostname, not a FQDN. With Mandriva, your hostname is set
in /etc/sysconfig/network. Using the wizard takes care of everything. It
will prompt you to log out and in again, because of BitTwister's warning.
HTH,
Doug.
--
Life is either a daring adventure, or nothing.
- Helen Keller
-
Re: Change localhost
I always like a consensus!
Thanks I'll check it all out.
Regards
Alan