How to get the domain name on the command line
There’s /bin/hostname which prints the name of the machine, either including the domain (which is the default mode of operation) or without it. (I couldn’t verify that it really does that because I have no idea where to configure the domain name of my machine. :)