My answer is a combination of the above because I am connecting to my office via Fortinet SSL VPN for Ubuntu 16.04.
The first thing I had to do is bring up my terminal console and run the following command:
sudo nano /etc/resolvconf/resolv.conf.d/base
I added the following example:
searchdomain domain.local
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
Then I saved the file by pressing CTRL-O and closed nano by pressing CTRL-X.
I then did the following and it worked perfectly:
To make Chrome respect the new entry, do the follwing:
Edit /etc/hosts as @Renan described.
- Go to
chrome://chrome/settings/clearBrowserData.
- Choose since the beginning of time.
- Check Empty the cache, but uncheck everything else.
- Click Clear browsing data and wait for it to finish.
- Restart Chrome.
Chrome should respect your hosts file now.
127.0.0.1 www.google.com. However, google.com still leads to the Google home page. Do I need to refresh anything? Should I restart my computer? – David Faux Jun 03 '12 at 03:30127.0.0.1 google.com(without the www) after this line and check whether it works. – Renan Jun 03 '12 at 03:31127.0.0.1 google.comisn't working either. I'm not sure what's going on ... I know that/etc/hostsis a soft link to/private/etc/hostson a Mac, but I don't think that helps at all. – David Faux Jun 03 '12 at 03:53127.0.0.1 www.example.com, then acessing www.example.com, works? – Renan Jun 03 '12 at 03:54127.0.0.1 www.example.comas my /etc/hosts file. – David Faux Jun 03 '12 at 03:57hostsmaps hostnames to IP addresses, not vice versa. – Dennis Jun 03 '12 at 04:43