Anyone familiar with the internals of Linux knows about NSS; it's the subsystem that services, like gethostname() and such, delegate to. The code that actually makes DNS queries or reads /etc/passwd, etc., is in the form of NSS modules. Furthermore, additional NSS modules can be compiled and linked to, allowing developers to provide different ways to lookup hosts, users, etc.
I'm trying to find the equivalent subsystem in OS X, but it seems to be something that has changed frequently over the years. Apparently an old system called NetInfo was used since the NeXtStep days, but that hasn't been around since 10.4. This was apparently superseded by something called lookupd, but I don't think it's present in Lion anymore either, since there's no lookupd process running on my system, and man lookupd redirects to dscacheutil.
What is the current system Lion uses to delegate these kinds of lookups? Does Apple provide any documentation for writing new plugins for whatever this subsystem is, to allow for different backends to provide these services?
Another way to think of this question is: Which subsystem in OSX is responsible for reading /etc/hosts and resolving lookups based on its contents?
