Can I use my domain with my hosting while the domain is still pointed elsewhere?
Posted by Paul Nesbitt, Last modified by Paul Nesbitt on 20 September 2016 08:55 AM
Can I use a domain with my hosting while the domain is still pointed elsewhere? / Can I use my domain in a browser to check it's OK before changing the nameservers?
On occasion you may require to be able to use your actual domain name with your new hosting at PAC however the actual domain is still live on hosting elsewhere.
You may need to do this to test everything is as it should be before making the switchover to our website hosting and a temporary link will not cut the mustard, A great example of this would be when migrating a wordpress site or another site that will not display correctly because maybe the CSS links or images are hardcoded to the domain name.
The following will work with Windows only, when we get time to investigate the equivalent on a mac we will add it in here.
When you go to a website address or any other kind of lookup for a domain name that your computer queries your broadband ISP's name servers for the IP address of the domain name being queried (a DNS lookup) and then connects to the IP returned.
When you then go to www.yourwebsite.com in your web browser it will look it up where it is currently hosted and display it from there, However as described above you may have a need to see it at your new hosting to make sure everything works before pointing your domain name to PAC.
It is a lesser known fact that DNS always looks up locally first before then querying your ISP's name servers and will use the local DNS first if it finds it, Once you know that you can then add some local DNS records for your domain with the new IP of your hosting into the file Windows uses locally which will then mean your PC will see the website on your new hosting allowing you to test everything is fine.
To do this first you need to open Notepad as an administrator.
Type notepad into the search area as indicated below
This will then search and find Notepad as indicated below, right click it and choose "Run as administrator" and then if prompted if you would like it to make changes to your pc click "Allow"
Now Notepad will have opened up, click "File" then "Open"
You now need to navigate to the "hosts" file, first you need to change the type of file you want to open from *.txt to All Files (*.*) as indicated below
You should end up with All Files (*.*) as below
Next we need to navigate to the folder with the hosts file in.
The easiest way to do this is to copy and paste the path into the top of the Window we currently have open, first we need to clear what is already there so click the whitespace after whatever is in there as indicated below bearing in mind the path you see in the example below will differ from what you see.
When you click it you will see the actual path and it will be highlighted blue, delete what is in there and copy and paste the following into there instead and press return:
You should now see the same as the below picture, now click once on the hosts file as indicated and then click "Open"
Once the file is open you will see the following in the file
You now need to add two entries one with www. and one without for your domain name both associated with the IP address for your web hosting account with PAC which you can find in your initial new web hosting account details email or if you have access to WHM in list accounts it shows you which IP address a cPanel is using on the relevant line.
Add them in like below substituting the example domain with your actual domain and remember to substitute the IP address for the IP for the new hosting account.
Once you have entered your details next click "File" then "Save" and remember to keep the Notepad window open don't close it!
It is best now to close your web browser and re-open it before going to your website address which will now be served from your new hosting with PAC.
Once you have finished your testing simply remove the two lines you added and click "File" then "Save"
Other Versions Of Windows
For other versions of Windows the only difference for the above instructions is where you find Notepad all the rest is the same.
Generally in older versions you will find Notepad by clicking "Start" then "All programs" then "Accessories" and then you should see Notepad so follow the instructions from where you right click it and "Run as an Administrator"