added resolv_mx() function