DNS

The dns() function provide a way to resolve hosts.

dns(host=None)

Methods of DNS

resolve(host=None)

Return IP address of host. If host is None, then will resolve host used in initialization. If both are None then exception will be raised.

Returns:IP address
Return type:str

Example query:

dns('google.de').resolve()
'173.194.65.94'

dns().resolve('google.de')
'173.194.65.94'