My company's employees website can be accessed:
- from the outside world via its IP address 1.2.3.4 or name
employees.corp.com
- from inside the company's network via its IP address 192.168.1.2 or name
employees.corp.com
Problem: After commuting from home, accessing the website employees.corp.com
from inside the company often fails.
- When it fails, if I run
ping employees.corp.com
it says64 bytes from w91284.telco.com (1.2.3.4): icmp_seq=1 ttl=255 time=2.08 ms
. - I am the only person with this problem. All other employees browse
employees.corp.com
all the time, inside and outside, with no problem. I am also the only one using Linux (Ubuntu 2018.04 installed from scratch but I had the same problem with 2016.04).
I have found two workarounds for when that happens:
- Workaround A: Edit the URL to replace
employees.corp.com
with192.168.1.2
- Workaround B: Run
sudo service network-manager restart
Both of these workarounds fix the problem momentarily, but none is satisfying as they waste time every day. What would be a permanent solution?
Disabling or shortening DNS cache would make the whole Internet a bit slower to access so I would prefer if it is limited to this particular domain. I am open to completely different solutions too.
This systemd script restarts Network Manager when resuming from suspend.
You'll need to create this script, called
network-reset
, with sudo powers and save it into the directory/lib/systemd/system-sleep
. Then mark it executable using:The
logger
commands above allow you to audit results by runningjournalctl
or by looking in/var/log/syslog
.I was mostly satisfied with WinEunuuchs2Unix' solution but somehow it was still failing sometimes for whatever reason so I had to restart the network very often, often 4 times during the same sitting at my company desk.
I finally ended up setting my WiFi connection to always use both DNS addresses:
It probably results in slower connection sometimes, but at least I can connect to the company website reliably.