If you append h to your socks5 protocol prefix when using --proxy the DNS resolution happens on the other side of the socks proxy!
h
--proxy
curl --proxy socks5h://127.0.0.1:1080 http://internal-host