# How do I redirect from hosting service to my Home PC server?



## HuntTheShunt (Jan 30, 2010)

I have a working site that is hosted by a domain host (commercial web hosting service) by having a index.asp root page that redirects back to my local web-server PC.

This is OK to test that it works at-all but I presume no one else can see my PC and the user will see a link of http://192.*.*.* when I want the user to see http://MyWonderfullSite.co.uk

I'm confused as to which to set to what 

The Control Panel of the commercial web hosting service provides a facility for custom DNS records

MyWonderfullSite default A 87.*.*.* Edit Delete
MyWonderfullSite.co.uk default CNAME MyWonderfullSite.co.uk. Edit Delete

Should the default A be the public ip that (what's your ip would show) or the private ip of the hosting servers PC ip?
Should my default.asp page redirect to my public ip or the private ip of the hosting servers PC ip?

Should I care what the host file of the hosting servers PC says?
I presume I port-forward port 80 from the public ip to the local ip of the of the hosting servers PC?


Reason for website being on my PC is so I can learn the website stuff cheaply and then up-size to a commercial site when ready.

If you can help; thanks.


----------



## Uranium-235 (Aug 29, 2002)

if it points to your external IP, and your links are relitive, they will be linking with the domain name properly, only if you make the links http://192.168.x.x will it link that way, which will not work cause it will try to locally from thier end. 

it should be the Public IP, then you should forward 80 to your private IP on whatever router you're using


----------



## HuntTheShunt (Jan 30, 2010)

Uranium-235 said:


> if it points to your external IP, and your links are relitive, they will be linking with the domain name properly, only if you make the links http://192.168.x.x will it link that way, which will not work cause it will try to locally from thier end.
> 
> it should be the Public IP, then you should forward 80 to your private IP on whatever router you're using


Thank you for your prompt reply.

So I get this correct using my example:-
I set the default.asp page that is on the commercial host to redirect to my public Ip 87.*.*.* 

I set my Router to accept all connections on port 80 that go to my external Ip 87.*.*.* and set the Router to port forward these requests to 192.168.x.x on my local webserver PC 
Yes/No ?


----------



## Uranium-235 (Aug 29, 2002)

you can't change your host dns to point to your external IP? you have use a script to?


----------



## HuntTheShunt (Jan 30, 2010)

Uranium-235 said:


> you can't change your host dns to point to your external IP? you have use a script to?


 As you can see I am new to this.

Your comments have helped me see that I am going about this in the wrong way?

Since my commercial hosting service provides a facility for custom DNS records
Example below... 
MyWonderfullSite ........default. A........87.*.*.*.....................Edit Delete 
MyWonderfullSite.co.uk default CNAME MyWonderfullSite.co.uk. Edit Delete 
I presume the cname was www name that is propergated so that the user could type it and the A was the IP that a users who types MyWonderfullSite.co.uk gets routed to.

If I have the above correct all I then need to do is port forward (in my router) any requests for ip 87.*.*.* to port 80 requested to my Development Web server PC's local ip 192....... ?

And dump the default.asp page on the commercial hosting service as it is redundant?



Uranium-235 said:


> you have use a script to?


I presume that is what the "facility for custom DNS records" does?


----------



## Uranium-235 (Aug 29, 2002)

yeah just remember that you won't be able to access the server with your external IP Internally cause of a factor of NAT routing, so just use your internal IP when developing, and if you need to make sure it works externally hook to someone elses wireless and try that or use a web browser on your phone/pda


----------

