Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

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 ~]# 
share|improve this answer
    
Thanks! But that's not what I meant. I don't use HostnameLookups. I should have added the link with background information ( 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.