/etc/resolvconf/resolv.conf.d/head can be edited by hand. The comment in the file which says
DO NOT EDIT THIS FILE BY HAND does not apply to
/etc/resolvconf/resolv.conf.d/head itself but to
/etc/resolv.conf, to which the former is prepended.
Having said that, however, under normal circumstances you should not have to edit
/etc/resolvconf/resolv.conf.d/tail are provided as a way of forcing a head and tail onto the generated
resolv.conf should that be needed under exceptional circumstances, but if you are using resolvconf properly and under normal circumstances then you do not have to do this.
You say that the file content is
The presence of the line
nameserver 127.0.0.1 suggests that you are running a local forwarding nameserver such as dnsmasq. The file above is not what resolvconf normally generates under these circumstances. It normally generates a file like the following.
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
My guess is that on your system
/etc/resolv.conf is not a symbolic link to
../run/resolvconf/resolv.conf but is a plain file which may or may not be generated by something other than resolvconf. If the file is completely static then simply edit it so that it looks the way you want it to look. If the file is generated by some tool other than resolvconf then figure out what tool is generating the file and configure that tool.
Alternatively, restore the symbolic link
/etc/resolv.conf -> ../run/resolvconf/resolv.conf and configure resolvconf properly.
How do I remove localhost nameserver from resolv.conf?
The following instructions apply only to the case where you are using resolvconf to manage
/etc/resolv.conf is a symbolic link to
If the line
nameserver 127.0.0.1 is in one of the files in
/etc/resolvconf/resolv.conf.d/ then remove it from there.
Otherwise that line is coming from some locally running nameserver. Either de-install that nameserver or configure that nameserver not to register the address 127.0.0.1 with resolvconf. In particular, if you are running BIND 9 named locally, either remove it or set