Do you have your /etc/resolv.conf configured with a search suffix?
### BEGIN AUTOGENERATED CONFIG
### END AUTOGENERATED CONFIG
search mydomain.local mydomain.com sub.mydomain.local
This should append the domain to the host name. I think it was introduced to do so in version 126.96.36.199 and higher.
Also, as a general rule, you normally shouldn't proxy internal hosts through a gateway. Exclusions for internal hosts and IP ranges are usually applied in the browser so you don't proxy internal traffic. There are, of course, reasons people want to do this, but it is uncommon.
Thanks for your answer, that was what I was looking for. This solved the problem.