Getting DNS operation timed out error

File "C:\Users\Al Ghani Computer\AppData\Local\Programs\Python\Python310\lib\site-packages\pymongo\srv_resolver.py", line 82, in get_options raise ConfigurationError(str(exc)) pymongo.errors.ConfigurationError: The resolution lifetime expired after 21.606 seconds: Server 8.8.8.8 UDP port 53 answered The DNS operation timed out.; Server 8.8.4.4 UDP port 53 answered The DNS operation timed out.; Server 8.8.8.8 UDP port 53 answered The DNS operation timed out.; Server 8.8.4.4 UDP port 53 answered The DNS operation timed out.; Server 8.8.8.8 UDP port 53 answered The DNS operation timed out.; Server 8.8.4.4 UDP port 53 answered The DNS operation timed out.; Server 8.8.8.8 UDP port 53 answered The DNS operation timed out.; Server 8.8.4.4 UDP port 53 answered The DNS operation timed out.; Server 8.8.8.8 UDP port 53 answered The DNS operation timed out.; Server 8.8.4.4 UDP port 53 answered The DNS operation timed out.
after changing dns got this error