In case of gethostbyname(), it returns ip addr by doing name resolution using DNS and /etc/hosts or Netbios.
How will gethostbyaddr() work? how will this function get hostname from address ?
In case of gethostbyname(), it returns ip addr by doing name resolution using DNS and /etc/hosts or Netbios.
How will gethostbyaddr() work? how will this function get hostname from address ?
It depends on how host resolution is configured in the box. It could get from /etc/hostnames or so or from DNS or so...