Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 )

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 or dns name based access rules. For more background about my problem, see . 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

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
[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 ( ) 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

Your Answer


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.