From owner-freebsd-questions Mon Jun 23 09:12:42 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id JAA11366 for questions-outgoing; Mon, 23 Jun 1997 09:12:42 -0700 (PDT) Received: from d2si.com (macbeth.d2si.com [206.8.31.2]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id JAA11354 for ; Mon, 23 Jun 1997 09:12:35 -0700 (PDT) Received: (from alec@localhost) by d2si.com (8.8.5/8.8.5) id LAA06140; Mon, 23 Jun 1997 11:12:19 -0500 (CDT) From: Alec Kloss Message-Id: <199706231612.LAA06140@d2si.com> Subject: Re: DNS or Apache? In-Reply-To: <2.2.32.19970623013412.006a56d4@mail.thsos.com> from Paul at "Jun 22, 97 08:34:12 pm" To: webmstr@thsos.com (Paul) Date: Mon, 23 Jun 1997 11:12:19 -0500 (CDT) Cc: questions@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Paul is responsible for: > Hi, > > I tried to set up a virtual server using the > name retail.foo.com. I already have a working > server on www.foo.com. The retail version points > to a different directory. > My domain.db looks like this..... > > localhost IN A 127.0.0.1 > ; > ; > mymachine IN A 200.100.100.1 > ; > router IN A 200.100.100.2 > IN MX 10 mail.mydomain.com. > ; > ftp IN CNAME mymachine.mydomain.com. > mail IN CNAME mymachine.mydomain.com. > news IN CNAME mymachine.mydomain.com. > ns IN CNAME mymachine.mydomain.com. > www IN CNAME mymachine.mydomain.com. > retail IN CNAME mymachine.mydomain.com. > > retail.mydomain.com resolves to my web server... > my foo.com record looks like this........ > > @ IN SOA foo.com. hostmaster.foo.com. ( > 15 ;Serial number > 172800 ;Refresh every 2 days > 3600 ;Retry every 2 day > 1728000 ;Expire every 20 days > 172800 ) ;Minimum 2 days > ; > IN NS ns.mydomain.com. > IN NS ns2.backup.net. > IN MX 5 mail.foo.com. > ; > localhost IN A 127.0.0.1 > www IN A 200.100.100.5 > retail IN A 200.100.100.5 > IN MX 10 mail.foo.com. > mail IN CNAME mail.mydomain.com. > > the virtual hosts in the web server httpd.conf are set up as > one is www.foo.com > the other retail.foo.com > with two different directories specified > > I tried using the same Internet address then tried setting up > a different ethernet address in the netstart... > neither way works to resolve to the virtual web server the error > is retail.foo.com DNS entry not found > I did also include the retail.foo.com in the reverse.db > > Can someone let me know what I am doing wrong? Or suggest a better > way for doing... like one that works? > > Thanks, > > Paul Webmaster@thsos.com > As I understand it, you must create multiple IP addresses for the web server. What happens is, first the host name is resolved into a IP address by the client, and then the client connects to the address. There is no way for the server to figure out what DNS name was used to connect, just the address. You'll have to use the alias option of ifconfig to assign a network card several IP addresses, and then bind each address to a specific hostname, and then set up Apache with Virtual Host directives for each address. The ifconfig command to add an alias is ifconfig ed? inet 200.100.100.5 netmask 0xffffffff alias I hope this helps a bit.