And if you need to use Python to get this data, you can do this: short_hostname, separator, domain = os.uname()[1].partition('.') long_hostname = os.uname()[1]
And if you need to use Python to get this data, you can do this: )[1].partition( '.')
short_hostname, separator, domain = os.uname(
long_hostname = os.uname()[1]