1

Is it possible to progamatically change the Preferred DNS servers for an active WIFI IPV4 connection using Delphi 10.3 and Windows 10? There are occasions when it would be useful for my program to use alternative DNS Servers. Normally to change them one has to take the long route of going through Network and Internet Settings and manually adding the preferred DNS Addresses. I was hoping to find an API call that may address this issue and allow me to simply select my chosen DNS Addresses from a combobox or similar and switch between the chosen addresses and those provided by the ISP, but as of yet my internet searches have yielded nothing.

Any Help would be much appreciated.

WobblyBob
  • 109
  • 1
  • 12
  • Have you seen this: https://stackoverflow.com/a/26087570/2292722 – Tom Brunberg May 07 '19 at 13:06
  • 1
    Most DNS query functions in Windows allow you to pass in a list of DNS servers to use. For example if you are making calls to the DnsQueryEx function you can include a list of DNS servers to use in the DNS_QUERY_REQUEST structure. using the pDnsServerList. – Brian May 07 '19 at 14:40
  • Hi Tom - I will check this out today and see if I can get it working - Many thanks – WobblyBob May 08 '19 at 07:56

0 Answers0