Summary: | have net.ethx auto-manage dhcp entries in /etc/hosts | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Evan Teran <evan.teran> |
Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED INVALID | ||
Severity: | enhancement | ||
Priority: | High | ||
Version: | 2004.1 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
example implementation (lines 106/217/218 are relavent changes)
improvment, implements it as postup/predown functions (all changes at bottom now) |
Description
Evan Teran
2004-05-04 20:43:57 UTC
Created attachment 30763 [details]
example implementation (lines 106/217/218 are relavent changes)
Created attachment 30764 [details]
improvment, implements it as postup/predown functions (all changes at bottom now)
This isn't how DHCP should work. If you do this then you're fooling yourself (well, okay, your machine ;-) into thinking that the hostname is associated with the address. If you want to do that, it's fine, but it's not for everybody. Instead, you should be using "dhcpcd -h hostname eth0" (where "hostname" is the preferred name of your machine) to request a certain name from the DHCP server. If things are configured correctly, this will also result in an updated DNS entry for your hostname/address association. In that case there is no need to update /etc/hosts at all. To accomplish this you can set dhcpcd_eth0="-h hostname" in /etc/conf.d/net Another alternative is to put your hostname on the same line with localhost so that you can always ping yourself, etc. Anyway, your solution isn't a good one for most people. Thanks for the suggestion, though. Glad to hear you can make use of the preup and predown functions. |