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
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop














{ 6 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 )
I have configure samba server in my machine when I am accessing the samba server it is perfectly accessing with ought user name and password but when I am configure it through user name and password its not accessing and that pop up window again come and asking username password and domain.
to to access my samba though user name and password in linux 5.0
hello friends.
Actually i want to know how can i check hosted Domain list on my server ,i mean what is the command, if anybody know then please reply me.i will be very thank full to you..
Hi friend.
Actually i want to know,how can i check domain’s list in through SSh ????????????
what is command for that ?