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

When reloading config (specifically for proxy_pass) - occasionally this will be seen: nginx: [emerg] host not found in upstream

However - the upstream server's name WILL resolve in the os (linux) - only nginx seems to have this problem.

This seems to be a recent regression - as it didn't seem to happen previous to 1.0.10 versions.

Has anyone noticed this recently?

Trying to narrow down places to search.

share|improve this question
up vote 4 down vote accepted

Nginx internally caches DNS for 5 minutes (not sure if this is configurable in later versions). Perhaps your resolver is failing for some reason, then Nginx caches this result.

I have seen this on systems with IPv6 enabled since be default the resolver requests both IPv4 and IPv6 records in parallel. This can be seen as a flood by the resolver resulting in a temporary DNS issue. I saw this popup on a box with a lot of email traffic when doing domain name verification.

Try adding:

  options single-request

to /etc/resolv.conf

This causes IPv6/v4 lookups to be done sequentially.

share|improve this answer
Thanks for your answer. It turned out this was an error with messing up the hostnames in the config files. Oops. But your answer is actually really useful anyway - so I will mark it as the right one - as it would cause DNS issues, for sure (blasting it with requests). – Michael Neale Jan 31 '12 at 3:35
I have the same issue - what exactly did you do in the config files to fix this (thanks in advance) – Zabs Oct 27 '14 at 10:58

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.