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.

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

1 Answer 1

up vote 2 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

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.