News for hackers. Stuff that matters.
Re:Some ways DNS can break by octoberfranklin on Monday January 17, 2022 @05:03AM (#29965004)
> Who is overwriting /etc/resolv.conf?

    echo 'nameserver 127.0.0.1' > /etc/resolv.conf
    chattr +i /etc/resolv.conf
You can thank me later.
Re:Some ways DNS can break by klapatsibalo on Monday January 17, 2022 @05:24AM (#29965131)
> A file with the 'i' attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file, most of the file's metadata can not be modified, and the file can not be opened in write mode. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.

So you essentially block any program trying to write it?

Re:Some ways DNS can break by tinus_hn on Monday January 17, 2022 @06:33AM (#29965544)
Yes. There’s software, like dhcp clients, that has claimed the right to automatically edit this without leaving a trace. It’s really hard to turn off, it’s easier to just ban this behavior categorically, if your use case is not the one in which this behavior is useful.
Re:Some ways DNS can break by octoberfranklin on Monday January 17, 2022 @05:30PM (#29972418)
This. I find it inexcusable that the Debian udhcpc package still does not provide any configuration option to inhibit it from overwriting /etc/resolv.conf.

The only option is to replace the "execute this when DHCP reply is recieved" script, which is not a simple script at all. And then you're stuck three-way-merging your changes to that script with every security update.

Re:Some ways DNS can break by hackeraccount on Monday January 17, 2022 @09:07AM (#29966656)
yeah that breaks my fucking VPN which won't start unless it can overwrite resolv.conf.

So now I have a job that watch for that and does a bind mount to make everything work.

Re:Some ways DNS can break by octoberfranklin on Monday January 17, 2022 @05:30PM (#29972421)
Get a better VPN, like wireguard.