After upgrading to 16.04 intranet address resolution was always hit or miss. I would get "can not resolve hostname" for many commands like ssh and immediately executing same command will resolve the host. The errors were only for intranet ip address and external ip addresses were getting resolved correctly.
I never faced these errors with previous versions of Ubuntu. We have not changed the router configuration.
This answer which basically asks to comment dns=dnsmasq entry, helped me to resolve the issue.
I don't understand impact of changing this entry. Why does it work after disabling dnsmaq entry? Is this some misconfiguration of router, my machine or a bug ?