2
I would like to perform something like a "nslookup" to resolve a site address through my DNS servers, because in the example below, I get only through the DNS I have on my machine.
How could I inform my server IP to resolve the Google address for example?
import socket
dns = socket.gethostbyname('www.google.com')
print(dns)
So, imagine that I have DNS servers of my own and want to resolve addresses like google, facebook through my DNS`s.
– Mário Rodeghiero
This, let’s assume that I want to resolve the www.terra.com address through google’s DNS(8.8.8.8), as I would do?
– Mário Rodeghiero
If you run this command on the terminal, you will understand "nslookup www.terra.com.br 8.8.8.8". With this command resolves the land address through google DNS.
– Mário Rodeghiero
Maybe this function will help:
gethostbyname_ex('www.google.com')
, See if that helps– Miguel
No, I need to figure out a way to pass my DNS address to address "www.google.com:
– Mário Rodeghiero