LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 11-22-2011, 12:59 AM   #1
Registered: Nov 2003
Posts: 79

Rep: Reputation: 15
Question domainname not returning anything

Dear Experts,

I've started installing Oracle 11G on Linux.

Part of the instructions say to configure the server with a (fqdn) fully qualified domain name.

I've followed the instructions I've been able to find, but I still can't get the command, domainname, to return anything.

This will be a stand alone machine for self study at home.
Named: black.

As for the domain name, I've been using my own domain, hosted elsewhere. Say, (not the actual name).

The hostname is:

Here is the output for some commands and files:

uname -a
Linux black 2.6.18-194.el5xen #1 SMP Mon Mar 29 22:22:00 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)

cat /etc/enterprise-release
Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)

cat /etc/issue
Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)

cat /etc/nsswitch.conf | grep hosts
#hosts: db files nisplus nis dns
hosts: files dns





# Do not remove the following line, or various programs
# that require network functionality will fail. localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6 black

Note that it is a static IP address.

ping black
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=64 time=0.048 ms

[root@black ~]# ping
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=64 time=0.054 ms

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface * U 0 0 0 eth1 * U 0 0 0 eth0 * U 0 0 0 virbr0 * U 0 0 0 eth0
default . UG 0 0 0 eth1


hostname --fqdn



What is the secret to getting a fully qualified domain name, such that the command, domainname will work?

Thanks a lot!
Old 11-22-2011, 01:08 AM   #2
LQ Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294

From the man page for domainname:
domainname - show or set the system's NIS/YP domain name
So the first question is: do you have a NIS/YP server running? If not, then there's no real use for this I think. You can set your FQDN to whatever you want since you'll be working only locally and in your resolv.conf you're pointing first to files, so if you configured it in your hosts file, it should work. In my opinion this has nothing to do with the domainname command not resolving. If you really need it, you can set it with the domainname command (man page).

Kind regards,

Old 11-29-2011, 02:07 AM   #3
Registered: Nov 2003
Posts: 79

Original Poster
Rep: Reputation: 15
Discovering the secret

gedit /etc/sysctl.conf





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
domainname? kalleanka General 2 06-12-2005 04:53 PM
sendmail and domainname zeky Linux - Networking 4 05-02-2005 01:09 PM
domainname pkp2372 Linux - Newbie 1 02-24-2004 10:40 AM
Problem with domainname rot Linux - Networking 4 08-11-2003 04:19 AM
domainname kevv Linux - Networking 1 05-03-2002 10:19 AM

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

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