View Full Version : How to Set Domainname on Redhat 9
CP
2003-09-25, 07:12 PM CDT
Hi Redhat Gurus,
I have been trying to set up a domainname for my Red Hat 9.0. Tried a
search on google, it did give some information, but didn't help me in
setting up the domainname successfully. When I use 'domainname' it is
returning '(none)'.
Any help or pointers to information would be highly appreciated.
Thanks in Advance!
CP
jbuchana@buchanan1.net
2003-09-25, 07:50 PM CDT
CP <csp2201@nospamnetscape.net> wrote:
> I have been trying to set up a domainname for my Red Hat 9.0. Tried a
> search on google, it did give some information, but didn't help me in
> setting up the domainname successfully. When I use 'domainname' it is
> returning '(none)'.
NIS domain or DNS domain?
"domainname" returns the NIS domain, which I doubt is what you are
really looking for...
"dnsdomainname" is supposed to return the DNS domainname, but on my
RH9 system it does not:
jbuchana@nemo$ hostname
nemo.buchanan1.net
jbuchana@nemo$ dnsdomainname
jbuchana@nemo$
All of this is covered in my man(1) hostname manpage. They explain
where dnsdomainname gets the domainname from, but I have not yet
followed up on that to see why it doesn't work.
--
Jim Buchanan jbuchana@buchanan1.net
=================== http://www.buchanan1.net/ ==========================
"But I found my voice eventually. What a surprise to find it so
emotionally disturbed. Where did Bill the Cat come from, for
chrissake?" -Berke Breathed
================= Visit: http://www.thehungersite.com ==================
Paul Lutus
2003-09-25, 07:54 PM CDT
CP wrote:
> Hi Redhat Gurus,
>
> I have been trying to set up a domainname for my Red Hat 9.0. Tried a
> search on google, it did give some information, but didn't help me in
> setting up the domainname successfully. When I use 'domainname' it is
> returning '(none)'.
>
> Any help or pointers to information would be highly appreciated.
Why do you think you need to set up a domain name? Don't you mean hostname?
What is in the file /etc/hosts?
What is in the file /etc/sysconfig/network?
--
Paul Lutus
http://www.arachnoid.com
CP
2003-09-25, 08:38 PM CDT
Hi Paul,
Paul Lutus wrote:
> CP wrote:
>
>
>>Hi Redhat Gurus,
>>
>>I have been trying to set up a domainname for my Red Hat 9.0. Tried a
>>search on google, it did give some information, but didn't help me in
>>setting up the domainname successfully. When I use 'domainname' it is
>>returning '(none)'.
>>
>>Any help or pointers to information would be highly appreciated.
>
>
> Why do you think you need to set up a domain name? Don't you mean hostname?
>
> What is in the file /etc/hosts?
>
> What is in the file /etc/sysconfig/network?
>
I am installing one application which needs the domainname to be
configured. Hostname has been setup correct and it is working fine.
$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 redhat redhat.mydomain.org localhost
192.168.254.2 wizard
$
$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=redhat
DOMAINNAME=mydomain.org
$
$ hostname
redhat
$ domainname
(none)
$ nisdomainname
(none)
$
Please help me with this.
Thanks
CP
Matt H
2003-09-25, 10:29 PM CDT
On Fri, 26 Sep 2003 02:38:08 +0000, CP wrote:
> $ cat /etc/sysconfig/network
> NETWORKING=yes
> HOSTNAME=redhat
> DOMAINNAME=mydomain.org
Get rid of "DOMAINNAME" and change "HOSTNAME=redhat" to
"HOSTNAME=redhat.mydomain.org"
Paul Lutus
2003-09-26, 01:05 AM CDT
CP wrote:
< snip >
> I am installing one application which needs the domainname to be
> configured. Hostname has been setup correct and it is working fine.
>
> $ cat /etc/hosts
> # Do not remove the following line, or various programs
> # that require network functionality will fail.
> 127.0.0.1 redhat redhat.mydomain.org localhost
NO! Did you read the lines above the one you changed?
The lines above the one you changed say this:
# Do not remove the following line, or various programs
# that require network functionality will fail.
Did you, like, just read those lines and just forge ahead? BTW it should say
"don't change this at all." Their wording was unfortunate.
Here is what the localhost line must look like on Red Hat:
127.0.0.1 localhost.localdomain localhost
Nothing. Else. At. All.
> 192.168.254.2 wizard
Is this the address assigned to the local NIC?
> $
> $ cat /etc/sysconfig/network
> NETWORKING=yes
> HOSTNAME=redhat
> DOMAINNAME=mydomain.org
No again. Do it this way:
DOMAINNAME=org
A hostname is a series of alpha characters, no punctuation (with some narrow
exceptions). So is a domain name. No periods in either.
--
Paul Lutus
http://www.arachnoid.com
Paul Lutus
2003-09-26, 01:24 AM CDT
Matt H wrote:
> On Fri, 26 Sep 2003 02:38:08 +0000, CP wrote:
>
>> $ cat /etc/sysconfig/network
>> NETWORKING=yes
>> HOSTNAME=redhat
>> DOMAINNAME=mydomain.org
>
> Get rid of "DOMAINNAME" and change "HOSTNAME=redhat" to
> "HOSTNAME=redhat.mydomain.org"
In fact, none of this works. No entry in /etc/sysconfig/network will ever
cause Red Hat 9 to accept any domain name whatsoever, after a reboot, after
anything. After investigating this further, I have reluctantly concluded he
should make a forced setting in /etc/rc.d/rc.localhost:
domainname (whatever)
Nothing else has the slighest chance of working.
The RH 9 init scripts (specifically, /etc/rc.d/init.d/ypbind) look for a
domainname by running `domainname`, but domainname has not been set at that
point, so this test always comes up empty. It is an oversight of long
standing.
--
Paul Lutus
http://www.arachnoid.com
Matt H
2003-09-26, 08:03 AM CDT
On Fri, 26 Sep 2003 00:24:49 -0700, Paul Lutus wrote:
> Nothing else has the slighest chance of working.
>
> The RH 9 init scripts (specifically, /etc/rc.d/init.d/ypbind) look for a
> domainname by running `domainname`, but domainname has not been set at that
> point, so this test always comes up empty. It is an oversight of long
> standing.
You were already told that 'domainname' returns the NIS domain name, if
you're not using NIS then the output from that command means nothing.
BTW, have you used redhat-config-network? That utility allows you to edit
the hostname as well. You should give it a shot. If you have a LAN you can
also add this line to your '/etc/hosts' (or use redhat-config-network):
192.168.1.10 machine.mydomain.net machine
Change the address to that of your network card.
Tim
2003-09-26, 08:49 AM CDT
CP wrote:
>> $
>> $ cat /etc/sysconfig/network
>> NETWORKING=yes
>> HOSTNAME=redhat
>> DOMAINNAME=mydomain.org
Paul Lutus <nospam@nosite.zzz> wrote:
> No again. Do it this way:
>
> DOMAINNAME=org
>
> A hostname is a series of alpha characters, no punctuation (with some narrow
> exceptions). So is a domain name. No periods in either.
Incorrect. However Red Hat chooses to interpret those settings, if
that's why you're stating this, that (org) is not the domain name.
For example, out of addresses like "www.example.com," or
"www.optusnet.com.au" the "domain names" are "example.com" and
"optusnet.com.au," respectively. Not just "com" nor "au," those are
top-level domains; nor would "example" or "optusnet" be anything by
themselves, either.
Just using the first address, the domain name registered by the owners
is specifically "example.com," which is entirely different from
"example.org," and "example.net," and so on.
Unless you were the owner of ".com.au" (for example), whom all people
wanting to register domain names ending with ".com.au" would be dealing
with (i.e. you're a registrar of domain names) you wouldn't be
configuring ".com.au" as your "domain name." Likewise for any of the
other top-level domains.
--
My "from" address is totally fake. (Hint: If I wanted e-mails from
complete strangers, I'd have put a real one, there.) Reply to usenet
postings in the same place as you read the message you're replying to.
Nat
2003-09-28, 11:03 AM CDT
On Fri, 26 Sep 2003 01:12:22 +0000, CP wrote:
> Hi Redhat Gurus,
>
> I have been trying to set up a domainname for my Red Hat 9.0. Tried a
> search on google, it did give some information, but didn't help me in
> setting up the domainname successfully. When I use 'domainname' it is
> returning '(none)'.
>
> Any help or pointers to information would be highly appreciated.
>
> Thanks in Advance!
> CP
AS ROOT, try the following:
dnsdomainname yournewdomain.org
You may also want to add "domain yournewdomain.org" to /etc/resolv.conf if
it does not do it for you...
Keith Clark
2003-09-28, 11:23 AM CDT
On Sun, 28 Sep 2003 17:03:49 +0000, Nat wrote:
> On Fri, 26 Sep 2003 01:12:22 +0000, CP wrote:
>
>> Hi Redhat Gurus,
>>
>> I have been trying to set up a domainname for my Red Hat 9.0. Tried a
>> search on google, it did give some information, but didn't help me in
>> setting up the domainname successfully. When I use 'domainname' it is
>> returning '(none)'.
>>
>> Any help or pointers to information would be highly appreciated.
>>
>> Thanks in Advance!
>> CP
>
> AS ROOT, try the following:
>
> dnsdomainname yournewdomain.org
>
> You may also want to add "domain yournewdomain.org" to /etc/resolv.conf if
> it does not do it for you...
The only problem with that is that on RedHat 9, /etc/resolv.conf is
overwritten every time /sbin/dhcpclient-script is run (every boot or every
time networking gets started/restarted). Look at the script and you'll
see... I ran into this when I was setting up "named" to resolve dns
addresses rather then rely on Verizon to do it (hopefully there will be a
class-action suit against verizon in the not too distant future).
vBulletin® v3.8.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.