Solved

What is the command to get the FQDN in SLES?

Posted on 2013-01-04
3
356 Views
Last Modified: 2013-01-07
Hi

What is the command to get the FQDN (fully qualified domain name) in SLES?
'hostname -f' is returning me 'localhost', what I want is abchost.corp.com

Thanks
Jamie
0
Comment
Question by:jamie_lynn
3 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 38745799
hostname -f works if you have your fully qualified hostname in /etc/hosts, which you obviously haven't.

I think you didn't set a hostname at all, or what do you get with "hostname" alone?

Anyway, you will have to perform a DNS lookup of your host's IP(s)

Get your IP(s) with "ifconfig -a" and perform "nslookup" or "dig" or "host" against the address(es).
0
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 38746890
Can you try:
hostname -A

Open in new window

0
 
LVL 11

Expert Comment

by:un1x86
ID: 38747429
It does not need to be in /etc/hosts. It can also be in the dns server to get the right entry of hostname --fqdn

What is in your /etc/hosts and what in your /etc/nsswitch.conf?
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now