If a name resolves in one tool and not in another, the answer is often not DNS at all. On Linux, a program that uses the system resolver library first looks at /etc/nsswitch.conf.
Look at the line for hosts:
grep ^hosts /etc/nsswitch.conf
A common result is hosts: files dns. The sources are asked in the order written, until one has an answer, so here /etc/hosts comes first and DNS second. A hit ends the search and a miss falls through to the next source, which is why an entry in /etc/hosts beats whatever the DNS server says.
Each source can carry an action in brackets, such as [NOTFOUND=return]. It means: if this source answered and did not know the name, stop here and skip the sources after it. You may see it on desktop systems in an entry like mdns4_minimal [NOTFOUND=return] dns.
To see what your programs really get, use getent hosts example.com. Caveat: dig and nslookup ask a DNS server directly and skip this file, so they can disagree with ping or a browser while nothing is broken. Edit the line with care, because a wrong order can make every lookup slow or fail.
Further reading: nsswitch.conf(5) manual
Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more