The IP address in the code you provided resolves yahoo because it is held by yahoo.
The IP address you use is for one host only. As you can imagine, Yahoo probably has thousands of servers. They are assigned allocation ipaddresses, which are then reused as they see fit for internal distribution. Different servers under the yahoo domain have different names, and therefore, when you refer to the IP address from a specific server, you get a name for that specific server. For a generic ipaddress for yahoo.com, which can be hidden if you do not want to use nslookup and request a series of ipaddress to find yahoo.com distributions and generalize from there.
source share