Re: Apache web host name resolution question

From: Ed Marsh (edmarsh_at_email.com)
Date: 07/09/04


Date: Fri, 09 Jul 2004 15:00:23 -0500

The browser is Netscape (7.x, if memory serves). The actual flow is very
simple. The HTML page lacated in the html web page directory simply
provides a form which is filled out and than "submits" the form data to
a PHP routine located in the same directory. I assume that the browser
(or server) decides to fully qualify the name of the PHP path name using
the server name (FQDN) and then attempts to resolve the name - thus, it
begins to query the DNS servers, times out, then begins to query a few
other servers like yahoo.

I found the "smart" domain guessing option you mentioned and when I get
home, I will see if that solves my problem.

thanks

David Efflandt wrote:
> On Fri, 09 Jul 2004 11:54:12 -0500, Ed Marsh <edmarsh@email.com> wrote:
>
>>I have just setup Apache web server, PHP, MySQL and PostgreSQL on my
>>Fedora Core II system. When writing some HTML pages which call remote
>>PHP routines, I noticed a long delay before the branched call to the PHP
>>routine completes. I snooped the network and noticed that the web
>>server is trying to resolve my server's hostname by going to the
>>external DNS server. After this fails it resubmits the request to Yahoo
>>and a few other lookup servers - fails, and then comes right back to my
>>home gateway router where it directs the call back to the IP address of
>>my Linux Apache server (where it should have been originally). The
>>delay is about 90+ seconds or so. I am trying to do some performance
>>testing, so this is not acceptable.
>>
>>I thought that the Apache web server would follow the instructions of
>>the /etc/nsswitch.conf file and check the local /etc/hosts file first to
>>resolve the hostname before using DNS, but this is apparently not the
>>case. I suspect that I am going to have to set up a local domain in my
>>private network and a proxy server to keep intranet queries local.
>>However, I am hoping that I am wrong and someone has a simplier solution.
>
>
> It could be your browser (which one?) that is using DNS and search first
> before /etc/hosts. Some have a built-in DNS cache, or attempt to search
> for a name. I know when I used to netscape, it thought that
> http://localhost/ was an incomplete FQDN and would attempt to search for
> localhost, and come up with localhost.com (a registered domain), which of
> course would not have the local resource I was looking for. That feature
> (Smart Search?) can be diasbled.
>
> I do not know how you construct those PHP URLs, but perhaps using
> HTTP_HOST from env and/or changing UseCanonicalName to off in apache may
> help, so your browser would use the name that worked (from Host header)
> instead of the server's set or assumed ServerName. But since you say
> "remote" PHP you may need to do something more if accessed from LAN
> or internet (maybe SSI or other dynamic content).
>



Relevant Pages

  • Re: HELP - Cant change Include Path
    ... Here is my php.ini path for the php.ini in both php and sql dirs: ... which did work on the remote linux server and sent me some mail ... Although my gmail acct picked the mail up as ... an attachment instead of as html - but gmail is really wierd about ...
    (comp.lang.php)
  • Re: Reading PHP files
    ... it's easy to download an HTML or even a PHP file from the web. ... Can you visit the address of the PHP page in your Web browser? ... The Web server is configured to handle different ...
    (alt.comp.lang.borland-delphi)
  • Re: How do I get HTML sent to server?
    ... sees in a client browser. ... html does only approximately show how different browsers, ... html is available on the server and can be directly taken from the ... html does not show the changes made to the DOM on the browser. ...
    (comp.lang.javascript)
  • Re: PHP-Yes, HTML-No --- Why?
    ... You are arguing to have .html at the end of every URL even if the file contains PHP or another scripting language. ... We are talking about web servers, not FTP servers. ... I never said the server should parse MP3 files or whatever, ...
    (comp.lang.php)
  • Re: How do I get HTML sent to server?
    ... sees in a client browser. ... html does only approximately show how different browsers, ... html is available on the server and can be directly taken from the server ... html does not show the changes made to the DOM on the browser. ...
    (comp.lang.javascript)