Update resolv.c

this version is portable to IPV6,i fix problems too...i improve to follow no deprecated functions...
Merge pull request #4 from CoolerVoid/patch-2

update resolv.c