Q. Under Windows Server 2003 I can use active directory domain tools to get information about current domain and hostname. Can you tell me command to list current domain name and hostname under Red hat enterprise Linux 5?
A. Both Linux / UNIX comes with the following utilities to display hostname / domain name:
a) hostname - show or set the system’s host name
b) domainname - show or set the system’s NIS/YP domain name
c) dnsdomainname - show the system’s DNS domain name
d) nisdomainname - show or set system’s NIS/YP domain name
e) ypdomainname - show or set the system’s NIS/YP domain name
For example, hostname is the program that is used to either set or display the current host, domain or node name of the system. These names are used by many of the networking programs to identify the machine.
$ hostname
Output
sun521nixcraft.com
The domain name is also used by NIS/YP or Internet DNS:
$ dnsdomainname
Output:
nixcraft.com
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- My 10 UNIX Command Line Mistakes
- Linux: 20 Iptables Examples For New SysAdmins

- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Facebook it - Tweet it - Print it -


{ 3 comments… read them below or add one }
Ciao, non conoscevo questi comandi (a parte il comando hostname)… Me li appunto :-)!
Matteo
Hi
Had a good read through your site. The featured articles is an excellent section. Learned loads of things I did not know about the Linux OS I didn’t know.
Good luck.
Gav
Thank you for the useful threads on your forum. Knowledge for all (especially for us newbies :-D )