Is there a way to know the server url and protocol used ? #1199
-
|
Below is an output from dig I want to know if dnspython has a utility method to return the server URL (dns.google) and the protocol used (HTTPS). This is so I can ensure that the server is actually responding to what the client has asked. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
|
Yes, the |
Beta Was this translation helpful? Give feedback.
-
|
I'm confused; in this case you know the URL and are specifying the transport (HTTPS). Do you want to know the IP address of the server actually used? If so see stackoverflow |
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
Yes, the
Answerobject from resolver methods, e.g.dns.resolver.resolve()has anameserverattribute which is the IP address of the nameserver which answered the query for non-HTTP-based queries, and the URL for HTTP-based queries.