Weird systemd resolv.conf behavior

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Weird systemd resolv.conf behavior

Adam Funk-4
Hi,

I've been having a strange problem with the systemd resolver on my
work laptop.  Basically, whenever I use it at the office, a "search"
line with the work domain is added to this file

/etc/resolv.conf -> ../run/resolvconf/resolv.conf

and it stays there after I suspend the laptop, carry it home, & wake
it up to use the wired or wifi home network.  The effect is that it's
impossible to resolve work hostnames.  Things I have tried (in various
combinations and sequences):

sudo service network-manager restart
sudo service systemd-resolved-update-resolvconf restart
sudo service systemd-resolved-update restart

The only thing that works is (yes, I know I shouldn't have to do
this!)

sudoedit /run/resolvconf/resolv.conf

to remove the offending line.  If I reboot, it comes up OK too.

Any suggestions?

Thanks,
Adam


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Weird systemd resolv.conf behavior

Tom H-4
On Wed, Mar 28, 2018 at 5:30 AM, Adam Funk <[hidden email]> wrote:

>
> I've been having a strange problem with the systemd resolver on my
> work laptop. Basically, whenever I use it at the office, a "search"
> line with the work domain is added to this file
>
> /etc/resolv.conf -> ../run/resolvconf/resolv.conf
>
> and it stays there after I suspend the laptop, carry it home, & wake
> it up to use the wired or wifi home network. The effect is that it's
> impossible to resolve work hostnames. Things I have tried (in various
> combinations and sequences):
>
> sudo service network-manager restart
> sudo service systemd-resolved-update-resolvconf restart
> sudo service systemd-resolved-update restart

"resolv.conf" is managed by resolvconf on your system and not by systemd-resolve

What does "/run/systemd/network/resolv.conf" look like at home and at
work, with and without the restarts (does
"systemd-resolved-update.service" exist?)?

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Weird systemd resolv.conf behavior

Adam Funk-4
On 2018-03-28, Tom H wrote:

> On Wed, Mar 28, 2018 at 5:30 AM, Adam Funk <[hidden email]> wrote:
>>
>> I've been having a strange problem with the systemd resolver on my
>> work laptop. Basically, whenever I use it at the office, a "search"
>> line with the work domain is added to this file
>>
>> /etc/resolv.conf -> ../run/resolvconf/resolv.conf
>>
>> and it stays there after I suspend the laptop, carry it home, & wake
>> it up to use the wired or wifi home network. The effect is that it's
>> impossible to resolve work hostnames. Things I have tried (in various
>> combinations and sequences):
>>
>> sudo service network-manager restart
>> sudo service systemd-resolved-update-resolvconf restart
>> sudo service systemd-resolved-update restart

The last one was a mistake for "sudo service systemd-resolved
restart"!

> "resolv.conf" is managed by resolvconf on your system and not by systemd-resolve
>
> What does "/run/systemd/network/resolv.conf" look like at home and at
> work, with and without the restarts (does

AFAICT, using it at work only adds the "search" line, which doesn't go
away after the restarts.  I'll check again tomorrow.

> "systemd-resolved-update.service" exist?)?
>


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Weird systemd resolv.conf behavior

Adam Funk-4
On 2018-03-28, Adam Funk wrote:

> On 2018-03-28, Tom H wrote:
>
>> On Wed, Mar 28, 2018 at 5:30 AM, Adam Funk <[hidden email]> wrote:
>>>
>>> I've been having a strange problem with the systemd resolver on my
>>> work laptop. Basically, whenever I use it at the office, a "search"
>>> line with the work domain is added to this file
>>>
>>> /etc/resolv.conf -> ../run/resolvconf/resolv.conf
>>>
>>> and it stays there after I suspend the laptop, carry it home, & wake
>>> it up to use the wired or wifi home network. The effect is that it's
>>> impossible to resolve work hostnames. Things I have tried (in various
>>> combinations and sequences):
>>>
>>> sudo service network-manager restart
>>> sudo service systemd-resolved-update-resolvconf restart
>>> sudo service systemd-resolved-update restart
>
> The last one was a mistake for "sudo service systemd-resolved
> restart"!
>
>> "resolv.conf" is managed by resolvconf on your system and not by systemd-resolve
>>
>> What does "/run/systemd/network/resolv.conf" look like at home and at
>> work, with and without the restarts (does
>
> AFAICT, using it at work only adds the "search" line, which doesn't go
> away after the restarts.  I'll check again tomorrow.
>
>> "systemd-resolved-update.service" exist?)?

This is what the resolv.conf file looks like at work or when I've been
using the computer at work without shutting it down (I think using the
VPN also adds the extra line):

#v+
# 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 shef.ac.uk
#v-

This is what it looks like if I reboot it at home (and this is how it
should look --- I can't connect from home to any work machines by
http(s) or ssh with the search line in place):

#v+
# 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
#v-

I have not been able to find a way --- other than sudoedit or
rebooting! --- to get rid of the extra line once it appears.  Some of
the commands that should restart the resolver even make it come back
after sudoedit.  Any suggestions?


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users