Sample Header Ad - 728x90

What's the "right way" to effect changes in /etc/resolv.conf with /etc/resolv.conf.d in place?

25 votes
3 answers
102341 views
I the old days, resolv.conf was static and you edited it yourself. Later on, the DHCP client would rewrite it, using some static entries and what it got from the DHCP lease. These days, some distributions - like mine (Linux Mint 18.1) have a /etc/resolv.conf.d mechanism with several subdirectories of scripts, and, well, I can't make heads and tails of it. What's the right way, then, to... - indicate that I want to use or not-use the DNS server(s) obtained in the DHCP lease? - add fixed entries to resolv.conf, always or as a fallback when there's no DHCP-lease-obtained nameserver? - make decisions about relative order in the file? I don't mind writing some scripts of my own if I have to, I just don't want to "work against" the existing mechanism or do duplicate work.
Asked by einpoklum (10753 rep)
Mar 9, 2017, 06:51 PM
Last activity: Jan 14, 2025, 01:39 PM