Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

What is the command to get the FQDN in SLES?

Posted on 2013-01-04
3
368 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 38

Expert Comment

by:Gerwin Jansen, EE MVE
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

839 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