net.dns: localize all string functions to reduce indexing.