0

I want to stop apache2 from querying the dns name at every start and to make it faster. There is absolutely no reason for apache to do any DNS-queries at all. For redirects it has to use the name passed in by the client in the host header. (See http://httpd.apache.org/docs/2.2/mod/core.html#usecanonicalname )

This is for an embedded device btw and if I expose the hostname setting in the gui I better have a good reason to do so and can explain 100% what is affected by it!

So far I only see that the hostname is used by apache for nothing and it is but into the syslog.

I don't use http://httpd.apache.org/docs/2.2/mod/core.html#hostnamelookups or dns name based access rules. For more background about my problem, see http://httpd.apache.org/docs/2.2/dns-caveats.html . There it says:

To get this address it uses either the global ServerName (if present) or calls the C function gethostname (which should return the same as typing "hostname" at the command prompt). Then it performs a DNS lookup on this address. At present there is no way to avoid this lookup.

Christian
  • 1,033
  • 5
  • 16
  • 24

1 Answers1

2

HostnameLookups (part of core - Apache HTTP Server). It should be Off by default though.

and localhost also should be part of your /etc/hosts by default

[root@wcmisdlin02 ~]# grep -c localhost /etc/hosts
2
[root@wcmisdlin02 ~]# 
alexus
  • 12,342
  • 27
  • 115
  • 173
  • Thanks! But that's not what I meant. I don't use HostnameLookups. I should have added the link with background information ( http://httpd.apache.org/docs/2.2/dns-caveats.html ) earlier! – Christian Jan 16 '13 at 23:34
  • I guess you should make sure that whichever hostname you're using is resolvable through DNS or if you don't want to use DNS then put it into hosts, localhost _IS_ already part of it, so you don't need to do that one. – alexus Jan 17 '13 at 18:00