Solved

What is the command to get the FQDN in SLES?

Posted on 2013-01-04
3
391 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
[X]
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
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

691 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