Score:1

How to prevent warp-cli from overwriting /etc/resolv.conf file

gs flag

Whenever I connect with warp-cli, it always generates a new resolv.conf file, as a result, if I ever disconnect from warp-cli I lose my internet connection, even though ping 8.8.8.8 and ping localhost both send and receive without any packet loss.

I need my resolv.conf file to be as follows in order to be online:

nameserver 8.8.8.8
nameserver 192.168.1.9

How can I prevent warp-cli from generating a new resolv.conf file that overwrites the default working one? Thank you!

cn flag
There is a warning inside the file: "# Do not edit." with an explanation why not to do this. If that is how warp-cli work ditch it and find a version compatible with current resolve.conf: warp-cli needs to APPEND to the file as all the other procedures (like NM, dhclient etc) do. And do tell them on their github page about this just in case it is possible to do have it append. I could not find it ;-)
Frobozz avatar
ng flag
Need more info. What OS? /etc/resolve.conf is a systemd managed file after Bionic.
William Le avatar
gs flag
@Frobozz my OS is ```Ubuntu 20.04.5 LTS```, ```5.15.0-67-generic``` linux core, would that be of any help?
Score:1
ng flag

I am not all that familiar with warp-cli but I would not imagine it would be altering /etc/resolve.conf

In later versions of Ubuntu (possibly since 18.04), /etc/resolve.conf is automatically generated by systemd (more accurately, replace by a symbolic link to a systemd generated file). Any changes made will simply be overwritten. However, you can define how it gets generated and behaves by editing one of the resolved.conf files under /etc/systemd.

Example: define the DNS servers and search domains by editing /etc/systemd/resolved.conf adding the following:

DNS=x.x.x.x y.y.y.y
FallbackDNS=z.z.z.z
Domains=mydomain.org corp.mydomain.org

(Note that nameserver will always be 127.0.0.53 in /etc/resolv.conf but lookups use those you defined)

Restart the service with systemctl restart systemd-resolved.service

Watch what resolved is up to with journalctl -u systemd-resolved -f

You may find the resolvectl tool worth checking out as well.

See man 5 resolved.conf and man resolvectl for all the details.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.