net: add more flexible server lookup