Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 May 2002 11:36:54 +0200
From:      "Patrick O'Reilly" <bsd@perimeter.co.za>
To:        "Byron Schlemmer" <me@byron.me.uk>, <freebsd-questions@FreeBSD.ORG>
Subject:   Re: /etc/hosts
Message-ID:  <00cf01c1f286$104d85e0$b50d030a@PATRICK>
References:  <20020503100414.2ca1b66d.me@byron.me.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message -----
From: "Byron Schlemmer" <me@byron.me.uk>

> Hi folks,
>
> I'm sure this is a trivial question however I'm struggling
> to find a definative answer, maybe I'm not looking hard
> enough. /etc/hosts, does it resolve names to IPs, IPs to
> names, or both? Does gethostbyname() and gethostbyaddr()
> both query /etc/hosts? Does it just depend on the
> application.

Byron,

it does both.  When/how it is used depends on /etc/host.conf, and
sometimes on the application.

I would guess that gethostbyname() and gethostbyaddr() will use
/etc/hosts depending on how /etc/host.conf is set.

But, "applications" like 'host' and 'nslookup' are dns specific, so they
will _NOT_ look at /etc/hosts.

I speak under correction, but this is my understanding :)

Regards,
Patrick O'Reilly.
    ___        _            __
   / _ )__ __ (_)_ __ ___ _/ /____ __
  / __/ -_) _) /  ~  ) -_), ,-/ -_) _)
 /_/  \__/_//_/_/~/_/\__/ \__/\__/_/
    http://www.perimeter.co.za




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00cf01c1f286$104d85e0$b50d030a>