How in the world is the API to know that "site" is the name of your variable and not the name of the host you are looking up?
pHostEnt = gethostbyname("site");
Do you see the quotation marks? What do you think that means?
No, I'm not going to give you the code that works, you'll not learn anything other than how to paste and you've demonstrated that you do that well.