Looking at /etc/resolvconf/update.d/*, I see a lot of code
duplication:
- formatting nameserver lines
- uniquifying nameserver/search lists
The reason for this is /lib/resolvconf/list-records, which is the
only API resolvconf exposes, and it's rather brittle anyway, since
it has to be run in the right directory.
I suggest that resolvconf grows a new API:
register-nameservers $NAME [$IP [$IP …]]
formats the list of IPs and calls resolvconf -a appropriately
reads list from stdin if ${2…} is empty
get-nameserver-ips [-a] [$NAME]
get a list of IPs associated with an interface, or all
IPs known to resolvconf, properly sorted and uniquified.
The -a option causes it to override truncating after localhost
entries.
unregister-nameservers $NAME
calls resolvconf -d for completeness
If there's a strong signal that this is wanted behaviour, I would
write the scripts.
Thanks,