Considering that in modern systems resolv.conf is often generated (and thus written) in runtime, /etc seems no longer correct location for it. What I'd really like to see is glibc looking for it somewhere in /var, and falling back to static /etc/resolv.conf if not found. I'm CC-ing NetworkManager, openresolv & openrc maintainers, as they're major cases of rewriting resolv.conf in Gentoo. I've already suggested that to NetworkManager upstream [1], and it seems that NM will allow supplying alternate resolv.conf path [2]. Not sure, however, if we should first post this to glibc ml or try to get a working implementation. [1]:http://mail.gnome.org/archives/networkmanager-list/2011-August/msg00031.html [2]:http://mail.gnome.org/archives/networkmanager-list/2011-August/msg00032.html
My concern about putting it in /var would be, will it be available early enough if /var is on a separate partition?
(In reply to comment #1) > My concern about putting it in /var would be, will it be available early > enough if /var is on a separate partition? That's why I'm suggesting not using weird kinds of things like symlinks and just falling back to /etc when not available at the moment. If someone needs resolver that early during the bootup, he/she is probably ok with some kind of static configuration as well. Also, someone mentioned using tmpfs-mounted /run for it. That seems like quite a good solution too.
i'm not interested in mucking with glibc ahead of it being merged upstream. if you want to develop/test, then you can easily do that yourself. as for symlinks + /var not being available, nothing is stopping you from keeping your "fallback" resolv.conf in an otherwise empty /var until it gets a chance to be mounted. nothing says /var must be empty in order to mount on top if it. so from the glibc perspective, there's nothing to do here. i think that really only leaves openresolv.