proskater123 Posted November 22, 2009 Share Posted November 22, 2009 Ok so I own two different domain names. Mine.net Mine.info I want to forward both to my static ip address. Same address for both. But i would want mine.net to go to my local machine 10.0.0.105 and mine.info to go to 10.0.0.111 What software or hardware will i need to do this or is it even possible? I was thinking about using the headers but no idea how. any ideas? Quote Link to comment Share on other sites More sharing options...
ssmithisme Posted November 22, 2009 Share Posted November 22, 2009 You only want to use these domains on you LAN? If thats the case then you didnt even need to spend money, you could have just set up a DNS server for you to use on your LAN. If you wanted to be able to connect to services running on these machines from the internet then you just need to forward the proper ports in your router to the machines. Quote Link to comment Share on other sites More sharing options...
Sparda Posted November 23, 2009 Share Posted November 23, 2009 If you have one internet IP address to share between the two computers you cannot assign the two domains to two machines at the same address. If you are thinking this is possible because web servers can this is not the case. A web server can host multiple sites on a single IP address because the client literally tells the server what host it is trying to reach and the http protocol has this feature as part of the specification, not all protocols (probably relatively few) can do this. It may be possible to achieve some thing similar to what you want depending on what you are doing. Quote Link to comment Share on other sites More sharing options...
Netshroud Posted November 23, 2009 Share Posted November 23, 2009 If you wanted to be able to connect to services running on these machines from the internet then you just need to forward the proper ports in your router to the machines. Both websites use port 80. What then? Quote Link to comment Share on other sites More sharing options...
digip Posted November 23, 2009 Share Posted November 23, 2009 Enter a cname record on both hosts dns that point to the IP address of your home IP. When people get to the servers by name, they will resolve to the ip of your home machine. Quote Link to comment Share on other sites More sharing options...
Netshroud Posted November 23, 2009 Share Posted November 23, 2009 Enter a cname record on both hosts dns that point to the IP address of your home IP. When people get to the servers by name, they will resolve to the ip of your home machine. I dont think that's will work properly. If I interpreted it correctly, this is what he's trying to implement. (I had the same question, but couldn't find a way to do it.) Quote Link to comment Share on other sites More sharing options...
digip Posted November 23, 2009 Share Posted November 23, 2009 Now Im confused. Maybe if he drew us a diagram of his physical network and where all these things sit it would be easier to understand. If its how you say in your picture above, then he would still need some sort of dns or edge server behind the router that handles the addresses for requests from the internet, or NAT configurations to redirect from the router to the servers. Quote Link to comment Share on other sites More sharing options...
VaKo Posted November 23, 2009 Share Posted November 23, 2009 You can't do it. Not with a home router and 1 CPE IP. You could need something like a NAT capable HTTP aware load balancer. Quote Link to comment Share on other sites More sharing options...
proskater123 Posted November 23, 2009 Author Share Posted November 23, 2009 in a way my set up is like what Psychosis said. Its not really just a website. Its the entire port range. So if I went to mine.net all the ports will go to 10.0.0.5 and same for the other. Is there a router that will be able to activly forward all the traffic based on the domain requested? Quote Link to comment Share on other sites More sharing options...
Sparda Posted November 23, 2009 Share Posted November 23, 2009 in a way my set up is like what Psychosis said. Its not really just a website. Its the entire port range. So if I went to mine.net all the ports will go to 10.0.0.5 and same for the other. Is there a router that will be able to activly forward all the traffic based on the domain requested? You need two internet IP addresses. A web server can host multiple domains because it knows the hostnames of the sites, and when the client requests the site it tells the server which one it's after, so the server returns that one. It only works with a single server, once you have multiple servers you need some clever routing rules to send traffic in the correct direction. http://httpd.apache.org/docs/2.0/vhosts/name-based.html Quote Link to comment Share on other sites More sharing options...
MRGRIM Posted November 23, 2009 Share Posted November 23, 2009 Would he need 2 Public IP's? Couldn't his router/firewall do some header analysis and route accordingly? Quote Link to comment Share on other sites More sharing options...
Sparda Posted November 23, 2009 Share Posted November 23, 2009 Would he need 2 Public IP's? Couldn't his router/firewall do some header analysis and route accordingly? Would only work on traffic that had such information. The OP wants TCP and UDP to work in this way whcih do not have such information. Quote Link to comment Share on other sites More sharing options...
MRGRIM Posted November 23, 2009 Share Posted November 23, 2009 Right, then my next question would be what senario would you want something like this? Quote Link to comment Share on other sites More sharing options...
Sparda Posted November 23, 2009 Share Posted November 23, 2009 Why would you want multiple internet IP addresses? Quote Link to comment Share on other sites More sharing options...
MRGRIM Posted November 23, 2009 Share Posted November 23, 2009 No ;) I know why you'd want them, but why as per the OP would you want them to resolve to different local IP's? Prehaps I'm missing something? The only reason I can them wanting to do this is for something like RDP/VNC so they can connect straight through via Hostname? Quote Link to comment Share on other sites More sharing options...
VaKo Posted November 23, 2009 Share Posted November 23, 2009 He wants to run 2 servers behind NAT, each providing different services, with 1 public IP using a DNS aware NAT service. The only way I could think of doing this would be for HTTP, and using a 3rd server as a load balancer of sorts to proxy requests. Bloody complicated for no real gain. Quote Link to comment Share on other sites More sharing options...
Sparda Posted November 23, 2009 Share Posted November 23, 2009 He wants to run 2 servers behind NAT, each providing different services, with 1 public IP using a DNS aware NAT service. The only way I could think of doing this would be for HTTP, and using a 3rd server as a load balancer of sorts to proxy requests. Bloody complicated for no real gain. The only benefit would be been able to physically separate each web site... except... shared hosting is cheap because lots of sites are hosted on a single box... so at this point you may as well get lots of internet IP address because you already bought two servers. Quote Link to comment Share on other sites More sharing options...
3w`Sparky Posted November 23, 2009 Share Posted November 23, 2009 isn't this just NAT with some PAT both domains are pointing to the same real IP Address but the domain redirection needs to be per port basis, 80 is to www server - and 8080 to something else. or have i not understood a bloody word of everything above ? Quote Link to comment Share on other sites More sharing options...
VaKo Posted November 23, 2009 Share Posted November 23, 2009 Yes, you can forward to multiple IP's on a per-port basis, thats quite easy. However getting your router to forward requests made to the same port on to 2 different internal IP's based purely on the domain name used in the request is a lot more complex. You would need something that could read the requests and proxy them on to the different servers based on that. If your going to do that with apache sites, its a hell of a lot easier to forward the relevant ports to a single server and use shared hosting. Quote Link to comment Share on other sites More sharing options...
ssmithisme Posted November 24, 2009 Share Posted November 24, 2009 If both machines are running different websites on port 80. You cant forward the port to both of them. So what you should do is put both websites on 1 server. Once both websites are on 1 server, Im going to assume you are using apache, Create a Virtualhost host for the different domains. Then forward port 80 to the webserver. so if you request blah.info it will send you to the webroot you set up for blah.info and if you request blah.com it will send you to the webroot you set up for blah.com Quote Link to comment Share on other sites More sharing options...
wh1t3 and n3rdy Posted November 24, 2009 Share Posted November 24, 2009 God bless apache Quote Link to comment Share on other sites More sharing options...
h3%5kr3w Posted November 24, 2009 Share Posted November 24, 2009 why not just specify in the LMHOSTS file? Quote Link to comment Share on other sites More sharing options...
Sparda Posted November 24, 2009 Share Posted November 24, 2009 why not just specify in the LMHOSTS file? Won't work on the internet. Quote Link to comment Share on other sites More sharing options...
digip Posted November 24, 2009 Share Posted November 24, 2009 If both machines are running different websites on port 80. You cant forward the port to both of them. So what you should do is put both websites on 1 server. Once both websites are on 1 server, Im going to assume you are using apache, Create a Virtualhost host for the different domains. Then forward port 80 to the webserver. so if you request blah.info it will send you to the webroot you set up for blah.info and if you request blah.com it will send you to the webroot you set up for blah.com I think with Vhosts and mod_rewrite you can also point to different machines on th elocal network. You can use one machine to host apache and 1 domain, another with apache and the second domain, but have the 1st machine handle all requests for domains, pointing to localhost for one, and some other IP on the lan for the other. If Im following correctly, I think thats whats going on in this post here: http://www.leveltendesign.com/blog/nickc/v...ation-localhost Quote Link to comment Share on other sites More sharing options...
VaKo Posted November 26, 2009 Share Posted November 26, 2009 You still have the issue that external clients will see one IP, and one IP alone. You need to have something listening on this single IP which then proxy's the request to one of 2 internal (and non publicly routable) IPs upon which a server is listening for request to that domain. You cannot simply re-direct the request to the IP because that IP will not be routable for clients outside your NAT and the connection will fail. So, you can either user a complicated proxy, multiple CPE IP's or simple apache shared hosting. This is pretty much the only way to do what the OP was asking for. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.