- Which function fills in an address needed for socket programming in a portable and protocol-independent way?
getaddrinfo() is the function to use for this.
- Which socket programming function can be used to convert an IP address back into a name?
getnameinfo() can be used to convert addresses back to names.
- A DNS query converts a name to an address, and a reverse DNS query converts an address back into a name. If you run a DNS query on a name, and then a reverse DNS query on the resulting address, do you always get back the name you started with?
Sometimes, you will get the same name back but not always. This is because the forward and reverse lookups use independent records. It's also possible to have many names point to one address, but that one address can only have one record that points back to a single name.
- What are the DNS...