In this recipe, we learn how to resolve DNS names (such as www.packtpub.com) to IP addresses using libnet. This recipe will introduce libnet functions that will resolve the address from the DNS name and display the address. It will also introduce the
libnet_init() function initializes and returns a libnet context. This context is the center of everything that libnet does. A libnet context should be initialized prior to using any of the libnet functions. The context should also be destroyed, using the
libnet_destroy() function, once it is no longer needed.
Prior to running the examples in the chapter, we will need to download and install libnet ...