Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

windows socket: gethostbyname() via proxy

Posted on 2002-05-13
7
Medium Priority
?
506 Views
Last Modified: 2013-11-20
I want to use gethostbyanme() on a client PC to validate some host names. My connection to Internet is through a proxy server, there is also a firewall. The function alsways return NULL, even on those definatly valid host names. But it works fine within the intranet. I want to know if it is because the proxy server or the firewall or both, and how to get around it?
0
Comment
Question by:CHED
  • 3
  • 2
5 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 7005772
You can't do this through a proxy.  When you are behind a proxy, the proxy does all the hostname resolution for your browser.  So the HTTP proxy protocol send the full URL and hostname to the proxy, which then resolves the host and performs the request.

On your system, there must be a DNS server defined that can resolve hostnames.  If not, or if the DNS server is a local server only, you will not be able to resolve hostnames that your DNS server doesn't know about.  And since you are behind the proxy, you cannot connect to an outside DNS server either.

Talk to your network admin about getting a "hole" through the firewall to do what you need to do.
0
 

Author Comment

by:CHED
ID: 7009975
Hi jhance,
Thanks for your comment.
Is it possible to use my current internet path on the proxy server to send the "gethostbyname" command to the outside world? For instance, my proxy server is "suchsuch" at prot:80, my question is can you direct the command to go through this path, as what IE does?
0
 

Author Comment

by:CHED
ID: 7009989
Hi jhance,
Thanks for your comment.
Is it possible to use my current internet path on the proxy server to send the "gethostbyname" command to the outside world? For instance, my proxy server is "suchsuch" at prot:80, my question is can you direct the command to go through this path, as what IE does?
0
 

Author Comment

by:CHED
ID: 7009993
Hi jhance,
Thanks for your comment.
Is it possible to use my current internet path on the proxy server to send the "gethostbyname" command to the outside world? For instance, my proxy server is "suchsuch" at prot:80, my question is can you direct the command to go through this path, as what IE does?
0
 
LVL 32

Accepted Solution

by:
jhance earned 320 total points
ID: 7010652
Since we're repeating ourselves here....


You can't do this through a proxy.  When you are behind a proxy, the proxy does all the hostname resolution
for your browser.  So the HTTP proxy protocol send the full URL and hostname to the proxy, which then
resolves the host and performs the request.

On your system, there must be a DNS server defined that can resolve hostnames.  If not, or if the DNS
server is a local server only, you will not be able to resolve hostnames that your DNS server doesn't
know about.  And since you are behind the proxy, you cannot connect to an outside DNS server either.

Talk to your network admin about getting a "hole" through the firewall to do what you need to do.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question