Link to home
Start Free TrialLog in
Avatar of tonelm54
tonelm54

asked on

Internal DNS issue

Ive setup a A record on a public DNS server to point to an internal IP. For example myTV.google.co.uk (I know my domain isnt google, its just an example) to point to 192.168.1.145, when I ping myTV.google.co.uk it doesnt resolve to any IP address, and when I try it using my browser I get page cannot be displayed.

Its always fascinated me why it doesn't work as from my understanding it should just pull the IP from the DNS record and then point to an internal IP, it shouldnt matter the DNS server cannot see it.

Is there an issue doing this? I know its probably not best practise, but assumed this is an easier way of doing a few items without setting up a DNS server at home.

Thank you in advance
Avatar of Mahesh
Mahesh
Flag of India image

When you are setting up host record on public dns server, how can it recognize private IP address range ?

That is why public IP are public IPs and private IP are private

If you want you can create above zone in your internal network DNS and said private IP host record
In that case you will get name resolution from private IP
But if you try to open any web page on that private IP through internet explorer that is having proxy settings, you will get error because IE will look for proxy 1st and then DNS
You need to bypass proxy for that url

Mahesh
myTV.google.co.uk <<< this needs to point to your Public IP the one that is at your location and goes out to the internet (Check what it is with: http://whatismyip.com).  If it's not a static IP you'll need something like zoneedit or dyndns to auto update your dns zones.

Anyway once you have the above done, your router /firewall needs to route port 80(Web site) to 192.168.1.145.  That's called port forwarding. Then it will work.
If we are talking about 2-5 systems then you can think of editing host file located in
C:\windows\system32\drivers\etc\

Below is the standard example of host content
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost


Just Add 192.168.1.145 so it will look like

#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1           localhost
192.168.1.145   myTV.google.co.uk
Avatar of tonelm54
tonelm54

ASKER

I understand if I goto myTV.google.co.uk it will return an internal IP address and I wont be able to access it externally, but should be able to internally surely.

The reason Im putting it on a public DNS is so I dont need to setup an internal DNS server, bit lazy but from what I see it should work shouldnt it?

Thank you
Hi,

Seems you want to access myTV.google.co.uk. then you need to do following.

1. create myTV.google.co.uk site (that you have already done).
2. Register myTV.google.co.uk, (that you have already done).
3. take a public IP (not private as you are thinking),  put that IP to your router.
4. Create DNS record for your myTV.google.co.uk and map with your Public (router) IP.
5. Open the port 80 and create a rule (NAT) on your router to MAP your http traffic to your 192.168.1.145

Now you should be able to access your site on internet.
You can access web site from internal network if you creates zone in internal DNS server for site and create host (A) record with private IP

There is nothing wrong in it and it is called as Split DNS where same url can be accessed in intranet by private IP and through public IP on internet

The another alternative is to create zone in internal DNS server for site and point it to directly to public IP address

But creating Host (A) record on public DNS server pointing to private IP will never works
Because it doesn't understand \ support private IP address and cannot route to your internal network

Mahesh
ASKER CERTIFIED SOLUTION
Avatar of tonelm54
tonelm54

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If everyone is happy I can just close this question and split points evenly between everyone?
if above post is not solved your query then you donot need to share points, you can close the question by selecting your comment as solution.
Not sure whats happened, but I have just deleted and re-added and it worked for 2 weeks, then stopped working.

Ive setup the A record as mypvr.local.mydomain.com to point to 192.168.1.70 which after 48 hours worked fine and I could ping it fine, however after 2 weeks it stopped working.

Deleted and re-added and worked fine again after 2 days. Tried using heartinternet and 1and1 which have the same issue. Not sure if its their terms and conditions that auto-delete it, cant find anything though, and their support say it shouldnt work anyway :-S