Avatar of sfun28
sfun28
 asked on

resolve specific sub-domains to internal IP addresses

Hi Experts!  I have 2 dynamic dns host names that point to my router (dd-wrt).  Lets say:
sub1.domain.com  and sub2.domain.com
with port mapping, everything works fine with external calls to these hosts

internally, I'd like map these hosts to internal IP addresses.  so if a request goes out for a webservice that sits inside my firewall, I don't want the request to leave the router just to find out that it points back to the router.  I can think of a few ways to do this:
1. can i tell my router about sub1.domain.com... and tell it to always route those requests to the appropriate machines?
2. maybe I can tell each individual machine about sub1.domain.com... and specifcy which internal IPs to map each host to?

not sure what the right approach is nor even the right vocabulary about how to discuss this issue.
DNSRouters

Avatar of undefined
Last Comment
tigermatt

8/22/2022 - Mon
tigermatt

Much easier - if you have a DNS server in your network, just add the entries to that internal DNS server with the appropriate static IP addresses on the record. You may need to create a new DNS zone for domain.com if it does not yet exist.

Please post back if you need more information.

-tigermatt
ASKER CERTIFIED SOLUTION
JFrederick29

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
sfun28

ASKER
Sorry...I failed to mention that I don't have a DNS server.  I just have a few computers behind a router/cable-modem.  The hosts file seems like a good solution.  Is there some config on the router (i'm using dd-wrt) that would accomplish the same task (so that I only have to update in one place)
JFrederick29

Does it work as is, meaning, can you connect to the external IP via the router (U-Turn on the router)?  If that works, I would simply use that "feature" and not worry about it traversing the router.  The router won't be able to handle the hosts file configuration unfortunately so you will have to update it manually or push it to each PC via a script of some sort.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
sfun28

ASKER
HI JFrederick29 - i'm not quite sure what you mean when you asked whether I can connect to the external IP via the router.  All of the machines behind the router can connect to sub1.domain.com, ...
With my webservices, i've noticed slow response time when using sub1.domain.com, but when I just use localhost, its super fast.  since I know, internally, that sub1, sub2, ... should point to specific internal IP addresses, I just want to configure that.  does this make sense?
JFrederick29

Yeah, makes sense.  That is what I was asking.  I would go the hosts file route if you notice a performance difference.
SOLUTION
tigermatt

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
sfun28

ASKER
Hi tigermatt,
That's a good observation...and its making wonder exactly what's causing the delays i'm seeing.  to be very specific, my web services are hosted as windows services using Windows Communication Foundation technology, part of the .net platform.  I've noticed that I get connection and data transfer timeouts when I use the full host name, but when i just localhost, everything runs smoothly.  so i'm not really sure where in the process things are getting held up.

in any case, i just wanted to throw that out there in case other people are experiencing the same thing and want to discuss.  otherwise, the hosts file seems like the way to go.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
tigermatt

Hi sfun28, just wondered why I wasn't split some of the points?
sfun28

ASKER
oh...sorry, i didn't know you could do that.  the ultimate solution was the hosts file which JFrederick29 just proposed.  i'm happy to split points - how would I do that?  sorry for the trouble.
sfun28

ASKER
i mean to say "...which JFrederick29 first proposed"
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
tigermatt

It's up to you, but just thought that the info I posted on the routing side of it may have helped. If you like I can request this is reopened so you can reclose and split points?
sfun28

ASKER
yes please!
sfun28

ASKER
upping points, and splitting
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
tigermatt

sfun28, thanks a lot :-)