Enter website through IP and not domain
I have tried - 1.2.3.4/srv/www/domain with no luck.
[1.2.3.4 - Is my IP]
7 Replies
@bryantrv:
I do it by pointing my computers hosts file to the dev ip- for me it is /etc/hosts - win uses something like c:\windows\system32\drivers\etc\hosts
How do I do it? What are the commands?
If you're using Linux, use your favorite text editor and open the file /etc/hosts.
If you're using Mac OS X, see this article: Mac OS X: How to Add Hosts to Local Hosts File
When you have your hosts file open, add the following line (replace my examples with your Linode's IP and your domain name):
1.2.3.4 example.com www.example.com
It doesn't matter how many spaces you have between each of these "words", or if you're using the
On Windows, if the hosts file does not exist, create it.
On Windows in Notepad when saving the file, put the filename in quotes -- like "hosts" -- to prevent Windows from automatically adding a .txt extension.
hosts.txt will not work, the file must be named hosts with no extension.
@NeonNero:
If you're using Mac OS X, see this article:
Mac OS X: How to Add Hosts to Local Hosts FileWhen you have your hosts file open, add the following line (replace my examples with your Linode's IP and your domain name):
1.2.3.4 example.com www.example.com
It doesn't matter how many spaces you have between each of these "words", or if you're using the
key, as long as there's some whitespace between them.
I a mac user - The link isn't working but I have edit my local /etc/hosts file and add this follow line:
1.2.3.4 domain.com domain [with the correct details].
I added the linode IP.
Nothing happens when entering this IP in the browser.
What am I missing here?
Working now…
Thank you…