From owner-freebsd-questions@FreeBSD.ORG Thu Jul 6 02:52:01 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 EE0C916A4DF for ; Thu, 6 Jul 2006 02:52:01 +0000 (UTC) (envelope-from dthomas53@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2ACC243D46 for ; Thu, 6 Jul 2006 02:52:00 +0000 (GMT) (envelope-from dthomas53@gmail.com) Received: by nf-out-0910.google.com with SMTP id o60so33859nfa for ; Wed, 05 Jul 2006 19:52:00 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=IUm7AkaXoHVjZdIqmYi35FqtLfFv6mrh9TL1jbaoQzQzhLqdC4apfei9jh40R6VDjWdDvrHGZzZOfhy284lzhPQUgy+53ESJ2pAV6HBFj1AkCD0iz45KwLCAXYKswjkUb2cHm8Naw0Mb/jsqC6RBOzP4j08HuB1RCJSsljBpW+Y= Received: by 10.78.165.16 with SMTP id n16mr20064hue; Wed, 05 Jul 2006 19:51:59 -0700 (PDT) Received: by 10.78.165.18 with HTTP; Wed, 5 Jul 2006 19:51:59 -0700 (PDT) Message-ID: Date: Wed, 5 Jul 2006 22:51:59 -0400 From: "David Stanford" To: "Michael S" In-Reply-To: MIME-Version: 1.0 References: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD Mailing List Subject: Re: DNS beginner question 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, 06 Jul 2006 02:52:02 -0000 On 7/5/06, Michael S wrote: > > Hi all. > > I am trying to set up a DNS service. I have 2 FreeBSD machines, one's > web and DNS (that I am setting up) and the other FTP. Both machines > are behind a router and get local addresses (i.e. 192.168....). If > DNS, FTP and web ports in the router are open, will I be able to set > up the DNS in a way such that when someone from the outside types > www.mydomain.com, he'll be taken to the machine that runs apache, and > when he types ftp.mydomain.com he'll be taken to the machine which > runs ftp? > By the way simply typing ftp://mydomain.com and http://mydomain.com > does the trick, but I want it to work with prefixes too. > > Hopefully my question isn't too confusing. > > Thanks in advance. > Michael > Hi Michael, You'll have to clarify "open" regarding the WEB, DNS, and FTP ports on the router. Are they simply port-forwarded to the internal servers (meaning based on service ports) or do you have one-to-one NAT mapping a public IP to an internal for each server? If it's the latter, and each machine has its own public IP, then you can simply set DNS to point to each server respectively: www.mydomain.com -> publicIP1 -> privateIP1 ftp.mydomain.com -> publicIP2 -> privateIP2 The real question is whether you have a block of public IPs or just one. But to be honest, you can probably get away with just having a single public IP and using port forwarding as most browsers (including Firfox and IE) recognize the "ftp" and "www" subdomains and automatically adjust to that protocol. i.e. ftp.somedomain.com will automatically be translated to ftp://ftp.somedomain.com (ftp.freebsd.org ). -David -- [root@fbsd ~]# fortune Happiness is just an illusion, filled with sadness and confusion.