Skip to content

Instantly share code, notes, and snippets.

@andrewspiers
Created March 10, 2014 02:18
Show Gist options
  • Save andrewspiers/9458439 to your computer and use it in GitHub Desktop.
Save andrewspiers/9458439 to your computer and use it in GitHub Desktop.
import socket
def dnsdomainname():
"""return the dns domain name of the current host."""
return '.'.join(socket.getfqdn().split('.')[1:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment