From owner-freebsd-questions@FreeBSD.ORG Thu Sep 11 21:49:48 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA0431065671 for ; Thu, 11 Sep 2008 21:49:48 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from be-well.ilk.org (dsl092-078-145.bos1.dsl.speakeasy.net [66.92.78.145]) by mx1.freebsd.org (Postfix) with ESMTP id B66E78FC08 for ; Thu, 11 Sep 2008 21:49:48 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: by be-well.ilk.org (Postfix, from userid 1147) id E2CE928431; Thu, 11 Sep 2008 17:49:47 -0400 (EDT) To: David Naylor References: <200809112249.05138.naylor.b.david@gmail.com> From: Lowell Gilbert Date: Thu, 11 Sep 2008 17:49:47 -0400 In-Reply-To: <200809112249.05138.naylor.b.david@gmail.com> (David Naylor's message of "Thu\, 11 Sep 2008 22\:49\:00 +0200") Message-ID: <443ak6tksk.fsf@be-well.ilk.org> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org Subject: Re: /etc/hosts not working X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2008 21:49:49 -0000 David Naylor writes: > I am trying to redirect a URL request to a different address but it appears > that /etc/hosts is not doing the job. Example: > > 127.0.0.1 google.com > > The way I understand it is that by typing google.com in a web browser it > should result in the local page being displayed. It instead goes to the > proper Google page. > > `ping google.com' actually pings 127.0.0.1 but `host google' returns the > actual IP addresses for google. Sounds like your browser is using a proxy server which is doing the name resolution for you. > /etc/nsswitch.conf has `hosts: files dns' and host.conf has `hosts\n dns' > > Any idea why the system calls are not honouring /etc/hosts? Since ping works, I'm sure that they are. -- Lowell Gilbert, embedded/networking software engineer, Boston area http://be-well.ilk.org/~lowell/