Search code examples
pythondnswmi

How to set secondary dns server with python


I success set default DNS server with wmi like this

SetDNSServerSearchOrder([dns])

But I can't found how to set secondary DNS with python


Solution

  • It's an array of DNS server addresses. Try

    SetDNSServerSearchOrder(['8.8.8.8','8.8.4.4'])
    

    The first is your primary, the second is your secondary