Update resolv.c

this version is portable to IPV6,i fix problems too...i improve to follow no deprecated functions...