I think you have misunderstood the setProxy() method, it is used to set the proxy for your HttpClient.
hostname: could be an IP address i.e: "192.168.1.100" or a DNS name like "proxy.example.com". port: it is the tcp/udp port on which your proxy server is listening.
As for your request of changing the DNS i think it is not possible.