[expert] DHCP and /etc/hosts

2003-04-04 Thread stefmit
Mandrake 9.0 (still) - laptop moving all over the place (i.e. IP address 
obtained via DHCP) - having built some tools (phpMyAdmin, mysqlnavigator, 
etc.) while connected in one place, with the FQDN (instead of localhost) I am 
having now problems when trying to use those tools from different places. 
Reason: simple - unless I manually change the /etc/hosts with the specific IP 
address of my FQDN, nothing would work.

If I try the following two lines - one at a time - from the CLI, I get the 
proper $IPADDR:

my_machine$ source /etc/dhcpc/dhcpcd-eth0.info
my_machine$ ping $IPADDR

but if I try to use a script like this:

source /etc/dhcpc/dhcpcd-eth0.info
$IPADDR machine.domain.extension machine

inside /etc/hosts, or cat-ed or -ed to /etc/hosts, it does not seem to 
work?!?

Does anybody have a cleaner way of updating /etc/hosts from dhcp info?

Thx,
Stef

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [expert] DHCP and /etc/hosts

2003-04-04 Thread James Sparenberg
On Fri, 2003-04-04 at 20:28, stefmit wrote:
 Mandrake 9.0 (still) - laptop moving all over the place (i.e. IP address 
 obtained via DHCP) - having built some tools (phpMyAdmin, mysqlnavigator, 
 etc.) while connected in one place, with the FQDN (instead of localhost) I am 
 having now problems when trying to use those tools from different places. 
 Reason: simple - unless I manually change the /etc/hosts with the specific IP 
 address of my FQDN, nothing would work.'

Suggestion... my hosts does this
127.0.0.1localhost.localdomain localhost
127.0.0.1jamlap.linuxpda.biz jamlap

this way no matter where I go or what my IP number is . I always
resolve.  proftpd won't start right no matter what I do if this isn't
true.

 
 If I try the following two lines - one at a time - from the CLI, I get the 
 proper $IPADDR:
 
 my_machine$ source /etc/dhcpc/dhcpcd-eth0.info
 my_machine$ ping $IPADDR
 
 but if I try to use a script like this:
 
 source /etc/dhcpc/dhcpcd-eth0.info
 $IPADDR machine.domain.extension machine
 
 inside /etc/hosts, or cat-ed or -ed to /etc/hosts, it does not seem to 
 work?!?
 
 Does anybody have a cleaner way of updating /etc/hosts from dhcp info?
 
 Thx,
 Stef
 
 
 __
 
 Want to buy your Pack or Services from MandrakeSoft? 
 Go to http://www.mandrakestore.com


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com