Solved

What is the command to get the FQDN in SLES?

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Recover Lacie Edmini data. 11 76
parallel rsync issues with Ubuntu 1 50
Windows 10 linux VM 30 92
Enable SPF on IMSVA 6 66
Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

732 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