Specify which DNS servers to use to resolve hostnames in .NET

前端 未结 4 1204
野性不改
野性不改 2020-12-09 10:46

I\'d like to know if there\'s any way to force the System.Net.Dns class to resolve hostnames using a set of custom DNS servers instead of using the ones that are associated

4条回答
  •  再見小時候
    2020-12-09 11:30

    If you're able to run your application inside a docker container you can provide the dns server ip address on start up.

    docker run --dns=1.2.3.4 repo/myimage command.exe

    https://docs.docker.com/v17.09/engine/userguide/networking/configure-dns/

提交回复
热议问题