My university network is changing resolv.conf. How do I prevent that?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
3
down vote

favorite
2












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)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 127.0.0.53
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?







share|improve this question






















  • You should probably have a look at askubuntu.com/questions/907246/…
    – vidarlo
    May 2 at 18:32






  • 1




    This seems to be the same problem as askubuntu.com/q/58781/696245
    – Arpit Jain
    May 2 at 18:34










  • I'll take a look at the second one but the first one seems to break VPN functionality for some users, something I also use (the University's VPN).
    – Peterson Silva
    May 5 at 2:22














up vote
3
down vote

favorite
2












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)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 127.0.0.53
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?







share|improve this question






















  • You should probably have a look at askubuntu.com/questions/907246/…
    – vidarlo
    May 2 at 18:32






  • 1




    This seems to be the same problem as askubuntu.com/q/58781/696245
    – Arpit Jain
    May 2 at 18:34










  • I'll take a look at the second one but the first one seems to break VPN functionality for some users, something I also use (the University's VPN).
    – Peterson Silva
    May 5 at 2:22












up vote
3
down vote

favorite
2









up vote
3
down vote

favorite
2






2





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)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 127.0.0.53
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?







share|improve this question














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)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 127.0.0.53
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?









share|improve this question













share|improve this question




share|improve this question








edited May 2 at 18:43









Arpit Jain

456




456










asked Apr 19 at 14:57









Peterson Silva

91114




91114











  • You should probably have a look at askubuntu.com/questions/907246/…
    – vidarlo
    May 2 at 18:32






  • 1




    This seems to be the same problem as askubuntu.com/q/58781/696245
    – Arpit Jain
    May 2 at 18:34










  • I'll take a look at the second one but the first one seems to break VPN functionality for some users, something I also use (the University's VPN).
    – Peterson Silva
    May 5 at 2:22
















  • You should probably have a look at askubuntu.com/questions/907246/…
    – vidarlo
    May 2 at 18:32






  • 1




    This seems to be the same problem as askubuntu.com/q/58781/696245
    – Arpit Jain
    May 2 at 18:34










  • I'll take a look at the second one but the first one seems to break VPN functionality for some users, something I also use (the University's VPN).
    – Peterson Silva
    May 5 at 2:22















You should probably have a look at askubuntu.com/questions/907246/…
– vidarlo
May 2 at 18:32




You should probably have a look at askubuntu.com/questions/907246/…
– vidarlo
May 2 at 18:32




1




1




This seems to be the same problem as askubuntu.com/q/58781/696245
– Arpit Jain
May 2 at 18:34




This seems to be the same problem as askubuntu.com/q/58781/696245
– Arpit Jain
May 2 at 18:34












I'll take a look at the second one but the first one seems to break VPN functionality for some users, something I also use (the University's VPN).
– Peterson Silva
May 5 at 2:22




I'll take a look at the second one but the first one seems to break VPN functionality for some users, something I also use (the University's VPN).
– Peterson Silva
May 5 at 2:22










1 Answer
1






active

oldest

votes

















up vote
0
down vote













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.



Example:



IP 192.168.x.xxx



Netmask 255.255.255.0



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
0.0.0.0 192.168.2.1 0.0.0.0 UG 600 0 0 wlp2s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlp2s0
192.168.2.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp2s0


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



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:



dns=default


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



nameserver 8.8.8.8
nameserver 8.8.4.4


Save the file pressing Ctrl+O



RESTART YOUR SYSTEM and connect to your network






share|improve this answer




















  • This will probably break wifi functionality if they're in a University environment that is not wired.
    – Thomas Ward♦
    May 4 at 18:18










  • @Thomas Ward . Why it should?
    – Claudio Taccogna
    May 4 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 at 19:29










  • I should be able to try that on Monday!
    – Peterson Silva
    May 5 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 at 20:52










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026424%2fmy-university-network-is-changing-resolv-conf-how-do-i-prevent-that%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













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.



Example:



IP 192.168.x.xxx



Netmask 255.255.255.0



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
0.0.0.0 192.168.2.1 0.0.0.0 UG 600 0 0 wlp2s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlp2s0
192.168.2.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp2s0


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



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:



dns=default


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



nameserver 8.8.8.8
nameserver 8.8.4.4


Save the file pressing Ctrl+O



RESTART YOUR SYSTEM and connect to your network






share|improve this answer




















  • This will probably break wifi functionality if they're in a University environment that is not wired.
    – Thomas Ward♦
    May 4 at 18:18










  • @Thomas Ward . Why it should?
    – Claudio Taccogna
    May 4 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 at 19:29










  • I should be able to try that on Monday!
    – Peterson Silva
    May 5 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 at 20:52














up vote
0
down vote













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.



Example:



IP 192.168.x.xxx



Netmask 255.255.255.0



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
0.0.0.0 192.168.2.1 0.0.0.0 UG 600 0 0 wlp2s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlp2s0
192.168.2.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp2s0


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



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:



dns=default


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



nameserver 8.8.8.8
nameserver 8.8.4.4


Save the file pressing Ctrl+O



RESTART YOUR SYSTEM and connect to your network






share|improve this answer




















  • This will probably break wifi functionality if they're in a University environment that is not wired.
    – Thomas Ward♦
    May 4 at 18:18










  • @Thomas Ward . Why it should?
    – Claudio Taccogna
    May 4 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 at 19:29










  • I should be able to try that on Monday!
    – Peterson Silva
    May 5 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 at 20:52












up vote
0
down vote










up vote
0
down vote









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.



Example:



IP 192.168.x.xxx



Netmask 255.255.255.0



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
0.0.0.0 192.168.2.1 0.0.0.0 UG 600 0 0 wlp2s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlp2s0
192.168.2.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp2s0


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



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:



dns=default


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



nameserver 8.8.8.8
nameserver 8.8.4.4


Save the file pressing Ctrl+O



RESTART YOUR SYSTEM and connect to your network






share|improve this answer












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.



Example:



IP 192.168.x.xxx



Netmask 255.255.255.0



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
0.0.0.0 192.168.2.1 0.0.0.0 UG 600 0 0 wlp2s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlp2s0
192.168.2.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp2s0


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



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:



dns=default


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



nameserver 8.8.8.8
nameserver 8.8.4.4


Save the file pressing Ctrl+O



RESTART YOUR SYSTEM and connect to your network







share|improve this answer












share|improve this answer



share|improve this answer










answered May 4 at 15:30









Claudio Taccogna

19418




19418











  • This will probably break wifi functionality if they're in a University environment that is not wired.
    – Thomas Ward♦
    May 4 at 18:18










  • @Thomas Ward . Why it should?
    – Claudio Taccogna
    May 4 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 at 19:29










  • I should be able to try that on Monday!
    – Peterson Silva
    May 5 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 at 20:52
















  • This will probably break wifi functionality if they're in a University environment that is not wired.
    – Thomas Ward♦
    May 4 at 18:18










  • @Thomas Ward . Why it should?
    – Claudio Taccogna
    May 4 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 at 19:29










  • I should be able to try that on Monday!
    – Peterson Silva
    May 5 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 at 20:52















This will probably break wifi functionality if they're in a University environment that is not wired.
– Thomas Ward♦
May 4 at 18:18




This will probably break wifi functionality if they're in a University environment that is not wired.
– Thomas Ward♦
May 4 at 18:18












@Thomas Ward . Why it should?
– Claudio Taccogna
May 4 at 19:21




@Thomas Ward . Why it should?
– Claudio Taccogna
May 4 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 at 19:29




@Thomas Ward. I mean, it's my daily wireless configuration and i have no problems at all with it.
– Claudio Taccogna
May 4 at 19:29












I should be able to try that on Monday!
– Peterson Silva
May 5 at 2:19




I should be able to try that on Monday!
– Peterson Silva
May 5 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 at 20:52




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 at 20:52

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026424%2fmy-university-network-is-changing-resolv-conf-how-do-i-prevent-that%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491