LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 01-03-2013, 10:14 AM   #1
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS, Mageia, Debian, Fedora, openSUSE, Ubuntu
Posts: 263

Rep: Reputation: Disabled
hostname -d returns <blank> - how to set domain name, CentOS 6.3


While having provblems with getting Samba server to work, different thread, I have noticed that 'hostname -d' returns blank. Is this correct or should I be setting this domain name somewhere?

Thanks,
Nick
 
Old 01-03-2013, 03:47 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,058

Rep: Reputation: 88
The two places where you need to have your hostname present are /etc/hosts and /etc/sysconfig/network files.

In /etc/hosts you need to have a line with the following format:

1.2.3.4 shorthostname.myexampledomain.com shorthostname

In /etc/sysconfig/network you need to have a line with the following format:

HOSTNAME=shorthostname.myexampledomain.com
 
1 members found this post helpful.
Old 01-04-2013, 06:56 AM   #3
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS, Mageia, Debian, Fedora, openSUSE, Ubuntu
Posts: 263

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by nini09 View Post
1.2.3.4 shorthostname.myexampledomain.com shorthostname
Thanks nini09, the problem was that I had the hosts entries in the wrong order with the shortname first:
1.2.3.4 shorthostname shorthostname.myexampledomain.com

Now fixed that and 'hostname -d' works fine.

Cheers,
Nick
 
  


Reply

Tags
centos, domain


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
set linux hostname & question about set multiple domain on one ip l0pht Linux - Networking 4 06-08-2012 11:14 AM
Sendmail doubling sender domain- ex. hostname.domain.net.domain.net halborr Slackware 7 08-23-2010 09:37 AM
Could someone explain to me the process of adding a hostname? (hostname.domain.com) brynjarh Linux - Server 2 10-18-2009 08:58 PM
Hostname and domain name. How do I set them? glore2002 Debian 2 08-17-2009 08:02 PM
Want to set up a new domain name and hostname? hamster Linux - Networking 6 04-06-2003 01:04 PM


All times are GMT -5. The time now is 04:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration