If DNS can't resolve the first time, try again. Also cleaned up
code for mail exchanger lookup.