When I connect to the internet in my university, through a PEAP, MSCHAPv2 protected WPA2 wifi network, it changes my resolv.conf to this:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

search ufsc.br

However, when I get home, I can't access the website as it tries to reach a local address which obviously isn't there. I have to manually remove the nameserver/search lines to be able to access it again.

My question is: what process is actually doing this - changing the file as I connect to my university's network? How can I find out which process is doing it and tell it to stop? Or, if this is necessary - how do I automatically roll the file back to an empty version when I leave the university's network?


I'd recommend to set a static IP through Network Manager first. Once connected to the network of your university, modify the settings going to the IPv4 tab and choosing the Manual method. Press the Add button and add your static IP.


IP 192.168.x.xxx


Gateway 192.168.x.x

Save your new configuration

To know your Gateway digit the following command in a terminal:

route -n

The output of the command should be something like this:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    600    0        0 wlp2s0     U     1000   0        0 wlp2s0   U     600    0        0 wlp2s0

As you can see my Gateway is and the IP you will choose will be a 192.168.2.xxx ( example ).

Disable the systemd-resolved service and stop it:

sudo systemctl disable systemd-resolved.service
sudo service systemd-resolved stop

Put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:


Install resolvconf:

sudo apt-get install resolvconf

and edit or create the file /etc/resolvconf/resolv.conf.d/tail

sudo nano /etc/resolvconf/resolv.conf.d/tail

Add Google nameservers (one per line) to the file


Save the file pressing Ctrl+O

RESTART YOUR SYSTEM and connect to your network

  • This will probably break wifi functionality if they're in a University environment that is not wired. – Thomas Ward May 4 '18 at 18:18
  • @Thomas Ward . Why it should? – Claudio Taccogna May 4 '18 at 19:21
  • @Thomas Ward. I mean, it's my daily wireless configuration and i have no problems at all with it. – Claudio Taccogna May 4 '18 at 19:29
  • I should be able to try that on Monday! – Peterson Silva May 5 '18 at 2:19
  • This didn't work - not because the file was still changed, but because the internet didn't work at all. Maybe Ward was right and it did break wifi functionality. – Peterson Silva May 7 '18 at 20:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.