I'm also getting this exception when I connect via VPN to my office.
My code tries to get TXT record instead of MX.
I do not understand why, but adding , tcp = True
solves my problem.
Try to add this parameter to the end of resolve
function:
dns.resolver.resolve("cmrit.ac.in", 'MX', tcp = True)
PS.
Adding , lifetime=10
also solves the problem, but it waits answer too long.
When I tested getting TXT record through nslookup:
nslookup -q=subdomain.example.com
, I have noticed that there were no nameserver
-list in output when I use VPN.
Maybe someone can explain this behavior?