I am attempting to migrate a website to a ubuntu server but would like to test it first
On windows I have changed my host file to point to the server, so the browser is opening the "new" site. In my terminal , in Ubuntu I have changed the following
127.0.1.1 example example
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
to
127.0.1.1 example example
127.0.0.1 localhost
104.236.247.139 www.example.com
104.236.247.139 example.com
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
Can I confirm that this is correct? I seem to be running into issues with finding http image urls etc, and before trying to debug I want to make the hosts file is correctly set.
Thanks
104.236.247.139 www.example.com example.com
(i.e., one entry per IP with multiple hostnames separated by space). – muru Mar 04 '15 at 11:34/etc/hosts
doesn't contain Windows line endings (CR-LF). You can check withfile /etc/hosts
orecho "I found $(tr -cd '\r' < /etc/hosts | wc -c) carriage return characters."
. – David Foerster Mar 04 '15 at 12:33