--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
> rather than grep xarging /etc for occurances of the ip and hostname is
> there a proper "debian way" of changing them?
Editing /etc/hosts ?
Paul Scott
> Matthew Lenz wrote:
>
> >rather than grep xarging /etc for occurances of the ip and hostname
> >is there a proper "debian way" of changing them?
>
> Editing /etc/hosts ?
That won't change the machine's IP.
The Correct Way to change a machine IP configuration and hostname is by
doing:
dpkg-reconfigure etherconf
(or apt-get install etherconf, if it's not installed)
This will ask you various questions about your setup and IP config, and
write results to all the pertinent files under /etc, such as /etc/hosts,
/etc/network/interfaces etc.
Cheers,
Dave.
--
Please don't CC me on list messages!
...
Dave Ewart - da...@sungate.co.uk - jabber: da...@jabber.org
All email from me is now digitally signed, key from http://www.sungate.co.uk/
Fingerprint: AEC5 9360 0A35 7F66 66E9 82E4 9E10 6769 CD28 DA92
I went through this experience a short while ago. All kinds of
recommendations about greping /etc, even that reinstalling linux is
the only safe way to change the hostname. But, in contast, there was
also the suggestion that all that is needed is to change /etc/hosts
and reboot. It makes one feel very insecure when there's such
conflicting advice out there.
I bit the bullet, changed /etc/hostname, and rebooted; nothing
else. As far as I can make out after a month, this procedure worked
beautifully. I can think of ways it could lead to a problem or two,
but I don't think that denies the basic soundness of the approach.
Haines Brown
I've done just the same in the past without any problems. In fact, I'm
not even sure I had to reboot, but certainly the only things I needed
to change were /etc/hosts and /etc/hostname.
Anthony
--
a...@acampbell.org.uk || http://www.acampbell.org.uk for
using Linux GNU/Debian || blog, book reviews, electronic
Microsoft-free zone || books and skeptical articles
>>>
>>>Editing /etc/hosts ?
>>
>>
>>I bit the bullet, changed /etc/hostname, and rebooted; nothing
>>else. As far as I can make out after a month, this procedure worked
>>beautifully. I can think of ways it could lead to a problem or two,
>>but I don't think that denies the basic soundness of the approach.
>>
Editing /etc/hostname will change the hostname but not the IP address.
The ip address of an interface is setup in /etc/network/interfaces (at
least for static ip addresses). For dynamic address you would need to
modify the DHCP server to return a different ip for your MAC. You also
may have to change any internal DNS servers to reflect the new name/ip
changes.
Others have already led you in the right direction. To summarize:
1) change IP address: edit interface information
in /etc/network/interfaces
2) change hostname: edit /etc/hostname and /etc/hosts
3) update nameserver information in /etc/resolv.conf
or /etc/network/interfaces if you use the resolvconf package.
But that only handles the bare minimum. You will also need to
reconfigure any software that has your old hostname, IP address,
netmask, network address, etc., hardcoded in its config files. In this
case grepping everything in /etc is the only sure-fire way to remember
what needs to be changed and what doesn't.
Note the above: you need to grep for more than just your IP address and
hostname. For example, I run the cups printing service and have the
statement "Allow From 64.172.171.64/29" in cupsd.conf which allows
network printing from all my other IP addresses. Grepping for any one
of my IP addresses (.65, .66, .67, .68, .69) would not have reminded me
that I need to change that statement to my new settings.
So, in short, grepping /etc _is_ the "proper" way. It feels brute force
but it isn't really. In fact, it helps you learn your system. Someone
else mentioned that when they were in a similar sitation they were told
to reinstall. BLECH!! That's gross. _That_ would be improper.
hth,
brian
dpkg-reconfigure etherconf
the only difference from etherconf and the sarge installer is that the sarge
installer puts some guesses into the fields for you first. The only other
difference I could see is that etherconf puts the FQDN in /etc/hostname
rather than just the host name.
> I think everyone should probably look at Dave Ewart's response. I
> tend to agree with him now that I've seen it in action.
>
> dpkg-reconfigure etherconf
>
> the only difference from etherconf and the sarge installer is that the
> sarge installer puts some guesses into the fields for you first. The
> only other difference I could see is that etherconf puts the FQDN in
> /etc/hostname rather than just the host name.
:-)
It is a very good, reliable tool for setting up your network config. It
ensures that you don't miss out anything that ought to be changed.
It's one of those tools where you find yourself saying "I can't believe
I didn't know *that* tool existed before ..."
Good
> But that only handles the bare minimum. You will also need to
> reconfigure any software that has your old hostname, IP address,
> netmask, network address, etc., hardcoded in its config files.
> In this case grepping everything in /etc is the only sure-fire
> way to remember what needs to be changed and what doesn't.
But in many cases the software should have been configured to
use "localhost" anyway, and this name -- the canonical hostname
corresponding to IP address 127.0.0.1, never changes.
Matthew Lenz wrote:
> The only other difference I could see is that etherconf puts
> the FQDN in /etc/hostname rather than just the host name.
Arrgh. I'll file a bug report about that. It is possible to
have a FQDN as one's system hostname, but this is not Debian
tradition and Debian configuration tools should be consistent.
--
Thomas Hood
Be that as it may, but I always use the FQDN in the hostname. It is
the traditional BSD way and also "just seems the right way" of doing
things. So etherconf should allow both policies.
Bob
> > But that only handles the bare minimum. You will also need to
> > reconfigure any software that has your old hostname, IP address,
> > netmask, network address, etc., hardcoded in its config files.
> > In this case grepping everything in /etc is the only sure-fire
> > way to remember what needs to be changed and what doesn't.
>
> But in many cases the software should have been configured to
> use "localhost" anyway, and this name -- the canonical hostname
> corresponding to IP address 127.0.0.1, never changes.
Good point. I was thinking from the point of view of having multiple
linux machines on a network. I guess not everyone's that lucky. ;-)