From owner-freebsd-questions@FreeBSD.ORG Fri Feb 17 19:22:41 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 591BA16A420 for ; Fri, 17 Feb 2006 19:22:41 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from smtp-out1.blueyonder.co.uk (smtp-out1.blueyonder.co.uk [195.188.213.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 852A043D46 for ; Fri, 17 Feb 2006 19:22:39 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from [192.168.0.2] ([82.41.229.193]) by smtp-out1.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Fri, 17 Feb 2006 19:23:43 +0000 Message-ID: <43F6227D.90302@dial.pipex.com> Date: Fri, 17 Feb 2006 19:22:37 +0000 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.12) Gecko/20051106 X-Accept-Language: en MIME-Version: 1.0 To: David Banning References: <20060217160651.GA22179@skytracker.ca> <002601c633dd$1a7349f0$1215450a@ad.ewsad.net> <20060217162952.GA31165@skytracker.ca> <20060217163347.GB13036@flame.pc> <20060217163844.GD31165@skytracker.ca> <20060217164447.GD13036@flame.pc> <20060217165959.GA42330@skytracker.ca> <20060217180907.GB13775@flame.pc> In-Reply-To: <20060217180907.GB13775@flame.pc> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 17 Feb 2006 19:23:43.0796 (UTC) FILETIME=[AA8D3F40:01C633F7] Cc: Giorgos Keramidas , freebsd-questions@freebsd.org Subject: Re: What about this solution 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: Fri, 17 Feb 2006 19:22:41 -0000 Giorgos Keramidas wrote: >On 2006-02-17 11:59, David Banning wrote: > > >>I just put >> >>209.161.205.12 banning.ca >> >>in my /etc/hosts and it solved the problem. >> >>Can I have multiple lines, each line with the same IP number in >>/etc/hosts, with different virtual hosts on the right? >> >> > >I think it's ok to have multiple lines, but I'm not sure. > > I think it works, but I don't think it's what the man page says and personally I wouldn't rely on it. I don't know if there is any line length limit, which matters if you have 50 or 60 host names on the line. Again the man page doesn't *say* there is a limit, but without checking source code I wouldn't bet on anything. My longest line is 247 chars without issues I have seen. From man 5 hosts > For each host a single line should be present with the following > informa- > tion: > > Internet address > official host name > aliases It's not clear to me what that means. If it means "for each official host name", then IP lines should be duplicatable. If it means "For each IP address" then multiple lines should not be used. FWIW, a Linux distro says: > This file > is a simple text file that associates IP addresses with > hostnames, one > line per IP address but actually seems to work fine with multiple lines with the same IP address. Go figure. >If that solves your immediate problem, then that's ok :) > > I didn't follow the thread that closely, but I understood that the wrong IP (127.0.0.1) was apparently being returned for a host name that should have had proper IP. Personally, I would want to find and fix that problem rather than hacking round it, otherwise it may come and bite you in the bum at some later date. Just my $0.02. --Alex PS At one point I thought you tried and failed to find a man page for nsswitch.conf. You might want to try again and check your typing as I can find one just fine of FreeBSD 5.4. host.conf probably doesn't have one any more because it is superceded by nsswitch.conf.