From owner-freebsd-questions Fri May 3 2:39:17 2002 Delivered-To: freebsd-questions@freebsd.org Received: from dns.perimeter.co.za (dns.perimeter.co.za [196.25.164.254]) by hub.freebsd.org (Postfix) with ESMTP id 4F99437B41E for ; Fri, 3 May 2002 02:39:11 -0700 (PDT) Received: from PATRICK (loopback.mipjhb [209.212.102.245] (may be forged)) by dns.perimeter.co.za (8.11.1/8.11.1) with SMTP id g439d0L36589; Fri, 3 May 2002 11:39:00 +0200 (SAST) (envelope-from bsd@perimeter.co.za) Message-ID: <00cf01c1f286$104d85e0$b50d030a@PATRICK> From: "Patrick O'Reilly" To: "Byron Schlemmer" , References: <20020503100414.2ca1b66d.me@byron.me.uk> Subject: Re: /etc/hosts Date: Fri, 3 May 2002 11:36:54 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ----- Original Message ----- From: "Byron Schlemmer" > 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