LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 09:14 AM   #1
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 299

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, 02:47 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
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, 05:56 AM   #3
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS 6, CentOS 7
Posts: 299

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



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 10:14 AM
Sendmail doubling sender domain- ex. hostname.domain.net.domain.net halborr Slackware 7 08-23-2010 08:37 AM
Could someone explain to me the process of adding a hostname? (hostname.domain.com) brynjarh Linux - Server 2 10-18-2009 07:58 PM
Hostname and domain name. How do I set them? glore2002 Debian 2 08-17-2009 07:02 PM
Want to set up a new domain name and hostname? hamster Linux - Networking 6 04-06-2003 12:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:51 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
Open Source Consulting | Domain Registration