# DNS with 1 IP



## notgreg (Oct 2, 2009)

Hello all,

I am going to be switching providers in a while and I have a few questions about my DNS setup.

Currently, I have a few ip addresses that are fully internet routable to me.  I have 1 DNS server on my FreeBSD 7.2-STABLE box.  My registered DNS domain name is visiable/used on my internal network and on the external internet.

My question is, when I switch providers, they will be giving me 1 static IP address.  How to I configure my DNS to use this 1 IP address?  If I change my DNS to all be this 1 IP, I won't be able to contact any (other) host on my internal network.  How would you do something like this?

Thankx for any help.


----------



## SirDice (Oct 2, 2009)

Are these hosts running the same service? As webserver i.e.?

If it's web you can setup a reverse proxy that accepts all incoming connections and proxies to the respective hosts based on the Host: header.


----------



## notgreg (Oct 6, 2009)

Hi SirDice,

Thankx for the reply.  I have heard about reverse proxies, and that would probably solve the problem for my web server, however, I want to ftp into my home network as well, and to multiple boxen on my network.

Having though about it over the (long) weekend we just had, I may have solved it myself.  What I can do is change my domain name for all my hosts on the inside, while keeping the domainname for the outside, and then just use NAT.

Do any networking guru's see any issues with that solution?


----------



## SirDice (Oct 6, 2009)

You will still have the problem when there are 2 websites you want to access on 1 external IP. Both will use port 80 so you need something to differentiate them. NAT only works on layer 3/4 (IP), it has no notion of layer 7 (HTTP).


----------



## notgreg (Oct 7, 2009)

Agreed.

If the 2 web sites were virtual websites on the same box, would that work?


----------



## SirDice (Oct 7, 2009)

notgreg said:
			
		

> If the 2 web sites were virtual websites on the same box, would that work?


Yes, that will work.


----------



## vivek (Oct 7, 2009)

Setup Apache virtual hosting and you can host 100s of website on a single public IP.


----------



## tingo (Oct 7, 2009)

wrt Apache:
in addition to what have already been suggested, if you run several physical server with Apache on them, you can always use the first one (the one that answers to NATed requests) as a proxy for the others.


----------



## notgreg (Oct 8, 2009)

Thankx guys.  I think I have enough to go on with now.  Good point, tingo.  I'll keep that in mind.


----------

