[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] IP address via DHCP



On Tue, Jul 31, 2001 at 09:42:53AM +0100, matt fairtlough wrote:
> This should be a simple one to answer.  I've looked at the man pages for 
> dhcp etc.  I've looked in /var/state/dhcp and /etc etc. but I haven't 
> found a good way to get my current IP address. 

ifconfig ?

> On my old system, the hostname was automatically changed to my ipaddress
> [which wasn't very convenient as I use hostname as part of my prompt
> string...]

DHCP has a system whereby the server can suggest a name to a client, among
other things - you could use this. You can also set specific leases to MAC
addresses - basically, tying the IP address to a specific client. You can
then set the hostname manually on the client.

> pc-62-31-17-212-sh.blueyonder.co.uk
> 
> but instead it was set to just pc-62-31-17-212-sh

The first is the fully-qualified name (FQDN), the second is just the
hostname. Either are valid. It's likely that in /etc/resolv.conf you would
have "domain blueyonder.co.uk", which would indicate that pc-62-31-17-212-sh
is in the domain blueyonder.co.uk (and hence has the FQDN we see above).

> which isn't much use as an IP address

. because it's not an IP address?

> same theme, how do I change the hostname to something other than "linux"?

/etc/hostname, among other methods.

These commands you also might find useful:

hostname -s		; the short host name
hostname -f		; the FQDN

Cheers,

Alex.

-- 
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.