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

Re: /etc/hosts: Two lines with the same IP address?



On Tue, Jun 08, 2004 at 02:40:55PM +0200, Thomas Hood wrote:
> but then:
> 
>     $ hostname --fqdn
>     localhost

Use -v to see what it  does.  Basically it does a 

gethostbyname(gethostname()) and uses  the h_name part, which is the first
entry in the /etc/hosts line with the hostname as an alias. Therefore you
sould do a:


127.0.0.1 hostname.doma.in hostname localhost

to make hostname --fqdn work

Greetings
Bernd
-- 
  (OO)      -- Bernd_Eckenfels@Mörscher_Strasse_8.76185Karlsruhe.de --
 ( .. )      ecki@{inka.de,linux.de,debian.org}  http://www.eckes.org/
  o--o     1024D/E383CD7E  eckes@IRCNet  v:+497211603874  f:+497211603875
(O____O)  When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl!



Reply to: