Per-user resolv.conf files
I want per-user resolv.conf files. I've mentioned this in a couple of places and got asked why. It's so that I can have a consistent set of aliases everywhere I go (so I can, eg, type ssh sdf instead of ssh sverige.freeshell.org) and also so that the resolver will fill in my choice of domain on the end of hostnames, so I can be lazy and type ssh plough instead of ssh plough.barnyard.co.uk.
Some quick googling didn't turn up anything usefully cross-platform, but the implementation shouldn't be too hard - just set LD_LIBRARY_PATH or LD_PRELOAD and provide my own resolver library. Unfortunately, the resolver is part of libc so I need to figure out how to:
- persuade arbitrary binaries to load an extra library;
- have that library effectively replace bits of libc ...
- ... even when the functions I'm replacing are called by other functions in libc
Damn, I might have to read about how the linker actually works if I'm ever to do this.