4 ms·
I needed to update /etc/resolv.conf under RedHat the other day and I was surprised by how much this has changed. You don't edit /etc/resolv.conf directly anymor
by js2 3y ago
I needed to update /etc/resolv.conf under RedHat the other day and I was surprised by how much this has changed. You don't edit /etc/resolv.conf directly anymore because it's maintained by Network Manager[1]. Instead you edit either one of the interface configuration files and tell NM (via nmcli) to reload it, or you use nmcli to update the interface config file.
Fine, I can deal with that.
What really surprised me were a couple programs that needed to be restarted to see the updated /etc/resolv.conf as they apparently don't use glibc for DNS resolution. I used lsof to figure out what was sending DNS requests to the old name server IPs.
It turned out to be osqueryd and Apache Traffic Server.
1. There are various ways to put /etc/resolv.conf back under manual control if you don't want NM to maintain it.
- marcosdumay 3y ago> Instead you edit either one of the interface configuration files and tell NM (via nmcli) to reload it Yeah, and this would be fine if both /etc/resolv.conf told you what is creating that file and NM didn't rewrite its own configuration files all the time. Anyway, it would be not that bad if NM was kept restricted to RedHat, because the entire philosophy of that distro is that configuration files are just suggestions and the system is free to change anything at any time. But instead, that behavior infected everything.
- js2 3y agoThe first line of resolv.conf is a comment indicating it's written by Network Manager. So that part didn't trip me up at least.
- marcosdumay 3y agoOn Debian it only says it's auto-generated and you shouldn't edit. It's not necessarily created by NM either¹, so it would be really helpful to have it. 1 - The policy of whatever configures your network last rewrites this file is spreading. Apparently systemd creates it first, and Debian has more than one network configurator for you to choose.