dnspython's stub resolver can be used to do queries using:
1) the default resolver object, using dns.resolver.query()
2) a resolver object you make and customize with dns.resolver.Resolver
These two only affect code directly calling the resolver objects. They do not affect other python code using standard interfaces, e.g. code doing socket.gethostbyname() or socket.getaddrinfo().
If you use the override_system_resolver() method, then you get
3) a resolver that works for all python code in the process where you made the override call.
There's no way to do these two things:
4) Override the resolver for all code, including C libraries, within a single python program
or
5) Override the resolver settings for all applications on the whole system (i.e. other processes).
If you are trying to do 1 or 2, then setting the "nameservers" field of the resolver object to the list of nameservers you want will work. This is what I thought you wanted on your github question.
If you want 3, then making the change and then calling dns.resolver.override_system_resolver() will work. Note that if you make a new resolver object (i.e. solution 2), then you pass that in.