* [gentoo-user] "hostname -d" returns no domainname
@ 2006-05-26 8:09 Alexander Skwar
2006-05-26 8:32 ` Neil Bothwick
2006-05-26 8:46 ` [gentoo-user] " Etaoin Shrdlu
0 siblings, 2 replies; 11+ messages in thread
From: Alexander Skwar @ 2006-05-26 8:09 UTC (permalink / raw
To: gentoo-user
Hello!
alexander@blatt ~ $ hostname -d
alexander@blatt ~ $ cat /etc/conf.d/domainname
# /etc/conf.d/domainname
# When setting up resolv.conf, what should take precedence?
# If you wish to always override DHCP/whatever, set this to 1.
OVERRIDE=1
# To have a proper FQDN, you need to setup /etc/hosts and /etc/resolv.conf
# properly (domain entry in /etc/resolv.conf, and FQDN in /etc/hosts).
#
DNSDOMAIN="bei.digitalprojects.com"
# This only set what /bin/hostname returns. If you need to setup NIS, meaning
# what /bin/domainname returns, please see:
#
# http://www.linux-nis.org/nis-howto/HOWTO/
#
NISDOMAIN="bei.digitalprojects.com"
alexander@blatt ~ $
Why does "hostname -d" not return a domainname? I would have
thought, that the "DNSDOMAIN" setting in combination with
"OVERRIDE=1" would set a DNS domain.
Why's that not so?
The system gets configured using dhcp, using dhcpcd.
Alexander Skwar
--
QOTD:
Y'know how s'm people treat th'r body like a TEMPLE?
Well, I treat mine like 'n AMUSEMENT PARK... S'great...
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] "hostname -d" returns no domainname
2006-05-26 8:09 [gentoo-user] "hostname -d" returns no domainname Alexander Skwar
@ 2006-05-26 8:32 ` Neil Bothwick
2006-05-26 9:43 ` [gentoo-user] " Alexander Skwar
2006-05-26 8:46 ` [gentoo-user] " Etaoin Shrdlu
1 sibling, 1 reply; 11+ messages in thread
From: Neil Bothwick @ 2006-05-26 8:32 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 327 bytes --]
On Fri, 26 May 2006 10:09:27 +0200, Alexander Skwar wrote:
> # To have a proper FQDN, you need to setup /etc/hosts
> and /etc/resolv.conf # properly (domain entry in /etc/resolv.conf, and
> FQDN in /etc/hosts).
What do these files contain?
--
Neil Bothwick
UNIX is the OS of the future and always will be...
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] "hostname -d" returns no domainname
2006-05-26 8:09 [gentoo-user] "hostname -d" returns no domainname Alexander Skwar
2006-05-26 8:32 ` Neil Bothwick
@ 2006-05-26 8:46 ` Etaoin Shrdlu
2006-05-26 9:45 ` [gentoo-user] " Alexander Skwar
2006-05-26 10:20 ` [gentoo-user] " Bo Ørsted Andresen
1 sibling, 2 replies; 11+ messages in thread
From: Etaoin Shrdlu @ 2006-05-26 8:46 UTC (permalink / raw
To: gentoo-user
On Friday 26 May 2006 10:09, Alexander Skwar wrote:
> Hello!
>
> alexander@blatt ~ $ hostname -d
> alexander@blatt ~ $ cat /etc/conf.d/domainname
> # /etc/conf.d/domainname
>
> # When setting up resolv.conf, what should take precedence?
> # If you wish to always override DHCP/whatever, set this to 1.
> OVERRIDE=1
>
> # To have a proper FQDN, you need to setup /etc/hosts and
> /etc/resolv.conf # properly (domain entry in /etc/resolv.conf, and
> FQDN in /etc/hosts). #
> DNSDOMAIN="bei.digitalprojects.com"
>
> # This only set what /bin/hostname returns. If you need to setup NIS,
> meaning # what /bin/domainname returns, please see:
> #
> # http://www.linux-nis.org/nis-howto/HOWTO/
> #
> NISDOMAIN="bei.digitalprojects.com"
>
> alexander@blatt ~ $
>
> Why does "hostname -d" not return a domainname? I would have
> thought, that the "DNSDOMAIN" setting in combination with
> "OVERRIDE=1" would set a DNS domain.
>
> Why's that not so?
>
> The system gets configured using dhcp, using dhcpcd.
I seem to remember that this was somehow related to /etc/hosts, look:
# cat /etc/hosts
10.0.0.10 mybox mybox.my.domain
# hostname -d
#
# (modify /etc/hosts)
# cat /etc/hosts
10.0.0.10 mybox.my.domain mybox
# hostname -d
my.domain
Don't know whether dhcp changes all this.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* [gentoo-user] Re: "hostname -d" returns no domainname
2006-05-26 8:32 ` Neil Bothwick
@ 2006-05-26 9:43 ` Alexander Skwar
2006-05-28 4:04 ` Zac Slade
0 siblings, 1 reply; 11+ messages in thread
From: Alexander Skwar @ 2006-05-26 9:43 UTC (permalink / raw
To: gentoo-user
Neil Bothwick <neil <at> digimed.co.uk> writes:
>
> On Fri, 26 May 2006 10:09:27 +0200, Alexander Skwar wrote:
>
> > # To have a proper FQDN, you need to setup /etc/hosts
> > and /etc/resolv.conf # properly (domain entry in /etc/resolv.conf, and
> > FQDN in /etc/hosts).
>
> What do these files contain?
alexander@blatt ~ $ grep -v \# /etc/hosts | grep -v '^$'
127.0.0.1 blatt
127.0.0.1 localhost
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
213.133.109.44 new.email-server.info
alexander@blatt ~ $ cat /etc/resolv.conf
# Generated by dhcpcd for interface ath0
search bei.digitalprojects.com
nameserver 192.168.1.1
nameserver 195.202.32.79
nameserver 82.207.232.1
nameserver 213.160.0.1
I don't think that I can set a "domain entry" in resolv.conf, as it's generated
by dhcpcd.
What does the DNSDOMAIN setting in /etc/conf.d/domainname do?
Alexander Skwar
--
There is brutality and there is honesty. There is no such thing as brutal
honesty.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* [gentoo-user] Re: "hostname -d" returns no domainname
2006-05-26 8:46 ` [gentoo-user] " Etaoin Shrdlu
@ 2006-05-26 9:45 ` Alexander Skwar
2006-05-26 10:20 ` [gentoo-user] " Bo Ørsted Andresen
1 sibling, 0 replies; 11+ messages in thread
From: Alexander Skwar @ 2006-05-26 9:45 UTC (permalink / raw
To: gentoo-user
Etaoin Shrdlu <shrdlu <at> unlimitedmail.org> writes:
> I seem to remember that this was somehow related to /etc/hosts, look:
>
> # cat /etc/hosts
> 10.0.0.10 mybox mybox.my.domain
>
> # hostname -d
> #
> # (modify /etc/hosts)
> # cat /etc/hosts
> 10.0.0.10 mybox.my.domain mybox
>
> # hostname -d
> my.domain
Great, this helped!
I now have:
alexander@blatt ~ $ grep -v \# /etc/hosts | grep -v '^$'
127.0.0.1 blatt.bei.digitalprojects.com blatt
127.0.0.1 localhost
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
213.133.109.44 new.email-server.info
And:
alexander@blatt ~ $ hostname -d
bei.digitalprojects.com
But I'd still like to know what /etc/conf.d/domainname does... Or rather: Is
supposed to do :)
Alexander Skwar
--
There is brutality and there is honesty. There is no such thing as brutal
honesty.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] "hostname -d" returns no domainname
2006-05-26 8:46 ` [gentoo-user] " Etaoin Shrdlu
2006-05-26 9:45 ` [gentoo-user] " Alexander Skwar
@ 2006-05-26 10:20 ` Bo Ørsted Andresen
2006-05-26 13:25 ` DNSDOMAIN in /etc/conf.d/domainname has no effect? (was: [gentoo-user] "hostname -d" returns no domainname) Alexander Skwar
1 sibling, 1 reply; 11+ messages in thread
From: Bo Ørsted Andresen @ 2006-05-26 10:20 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 379 bytes --]
Friday 26 May 2006 10:46 skrev Etaoin Shrdlu:
> I seem to remember that this was somehow related to /etc/hosts, look:
>
> # cat /etc/hosts
Changing:
> 10.0.0.10 mybox mybox.my.domain
to:
> 10.0.0.10 mybox.my.domain mybox
has just solved this issue for me. :) Thanks!
> Don't know whether dhcp changes all this.
I am using dhcp.
--
Bo Andresen
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* DNSDOMAIN in /etc/conf.d/domainname has no effect? (was: [gentoo-user] "hostname -d" returns no domainname)
2006-05-26 10:20 ` [gentoo-user] " Bo Ørsted Andresen
@ 2006-05-26 13:25 ` Alexander Skwar
2006-05-26 16:00 ` Zac Slade
0 siblings, 1 reply; 11+ messages in thread
From: Alexander Skwar @ 2006-05-26 13:25 UTC (permalink / raw
To: gentoo-user
Bo Ørsted Andresen wrote:
> Friday 26 May 2006 10:46 skrev Etaoin Shrdlu:
>> I seem to remember that this was somehow related to /etc/hosts, look:
>>
>> # cat /etc/hosts
>
> Changing:
>
>> 10.0.0.10 mybox mybox.my.domain
>
> to:
>
>> 10.0.0.10 mybox.my.domain mybox
>
> has just solved this issue for me. :) Thanks!
Same here!
But I wonder what this DNSDOMAIN setting in /etc/conf.d/domainname is
supposed to do. Because of
# When setting up resolv.conf, what should take precedence?
# If you wish to always override DHCP/whatever, set this to 1.
OVERRIDE=1
I thought that this setting would have an effect. Seems not so...
Alexander Skwar
--
To the systems programmer, users and applications serve only to provide a
test load.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: DNSDOMAIN in /etc/conf.d/domainname has no effect? (was: [gentoo-user] "hostname -d" returns no domainname)
2006-05-26 13:25 ` DNSDOMAIN in /etc/conf.d/domainname has no effect? (was: [gentoo-user] "hostname -d" returns no domainname) Alexander Skwar
@ 2006-05-26 16:00 ` Zac Slade
2006-05-26 17:40 ` [gentoo-user] Re: DNSDOMAIN in /etc/conf.d/domainname has no effect? Alexander Skwar
0 siblings, 1 reply; 11+ messages in thread
From: Zac Slade @ 2006-05-26 16:00 UTC (permalink / raw
To: gentoo-user
On Friday 26 May 2006 08:25, Alexander Skwar wrote:
> Bo Ørsted Andresen wrote:
> > Friday 26 May 2006 10:46 skrev Etaoin Shrdlu:
> >> I seem to remember that this was somehow related to /etc/hosts, look:
> >>
> >> # cat /etc/hosts
> >
> > Changing:
> >> 10.0.0.10 mybox mybox.my.domain
> >
> > to:
> >> 10.0.0.10 mybox.my.domain mybox
> >
> > has just solved this issue for me. :) Thanks!
Here is why this solved the issue for you. hostname -d and hostname --fqdn
get the domain part by using gethostbyname() so it does a DNS lookup on your
hostname. If your /etc/hosts.conf is set to files, bind then it will look
your hostname up in /etc/hosts then query DNS. If your /etc/hosts file has
an FQDN entry for your hostname then all is well. If not then your hostname
is queried in DNS using the domain statement in /etc/resolv.conf.
> But I wonder what this DNSDOMAIN setting in /etc/conf.d/domainname is
> supposed to do. Because of
It sets the domain in /etc/resolv.conf
> # When setting up resolv.conf, what should take precedence?
> # If you wish to always override DHCP/whatever, set this to 1.
> OVERRIDE=1
>
> I thought that this setting would have an effect. Seems not so...
This will determin whether DHCP will be allowed to replace your domain
statement in /etc/resolv.conf.
I hope this clears it up.
--
Zac Slade
krakrjak@volumehost.net
ICQ:1415282 YM:krakrjak AIM:ttyp99
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* [gentoo-user] Re: DNSDOMAIN in /etc/conf.d/domainname has no effect?
2006-05-26 16:00 ` Zac Slade
@ 2006-05-26 17:40 ` Alexander Skwar
2006-05-26 19:17 ` Hans-Werner Hilse
0 siblings, 1 reply; 11+ messages in thread
From: Alexander Skwar @ 2006-05-26 17:40 UTC (permalink / raw
To: gentoo-user
Zac Slade wrote:
> On Friday 26 May 2006 08:25, Alexander Skwar wrote:
>> But I wonder what this DNSDOMAIN setting in /etc/conf.d/domainname is
>> supposed to do. Because of
> It sets the domain in /etc/resolv.conf
No, it doesn't.
>> # When setting up resolv.conf, what should take precedence?
>> # If you wish to always override DHCP/whatever, set this to 1.
>> OVERRIDE=1
>>
>> I thought that this setting would have an effect. Seems not so...
> This will determin whether DHCP will be allowed to replace your domain
> statement in /etc/resolv.conf.
That's not what happens.
alexander@blatt ~ $ grep -v -e '#' -e '^$' /etc/conf.d/domainname
OVERRIDE=1
DNSDOMAIN="bei.digitalprojects.com"
NISDOMAIN="bei.digitalprojects.com"
alexander@blatt ~ $ cat /etc/resolv.conf
# Generated by dhcpcd for interface ath0
search bei.digitalprojects.com
nameserver 192.168.1.1
nameserver 195.202.32.79
nameserver 82.207.232.1
nameserver 213.160.0.1
> I hope this clears it up.
Nope :(
Alexander Skwar
--
Q: What happens when four WASPs find themselves in the same room?
A: A dinner party.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] Re: DNSDOMAIN in /etc/conf.d/domainname has no effect?
2006-05-26 17:40 ` [gentoo-user] Re: DNSDOMAIN in /etc/conf.d/domainname has no effect? Alexander Skwar
@ 2006-05-26 19:17 ` Hans-Werner Hilse
0 siblings, 0 replies; 11+ messages in thread
From: Hans-Werner Hilse @ 2006-05-26 19:17 UTC (permalink / raw
To: gentoo-user
Hi,
On Fri, 26 May 2006 19:40:02 +0200
Alexander Skwar <listen@alexander.skwar.name> wrote:
> Zac Slade wrote:
> > On Friday 26 May 2006 08:25, Alexander Skwar wrote:
>
> >> But I wonder what this DNSDOMAIN setting in /etc/conf.d/domainname is
> >> supposed to do. Because of
> > It sets the domain in /etc/resolv.conf
>
> No, it doesn't.
Well, it does (in /etc/init.d/domainname). But this is obviously
overwritten in your case by dhcp settings.
You're right with that OVERRIDE=1 doesn't fix this. Another start
of /etc/init.d/domainname should. The OVERRIDE flag just decides
whether the new "domain" setting goes to the start or the bottom
(OVERRIDE=1) of /etc/resolv.conf (that has influence, because
resolv.conf(5) says: "the last instance wins"). So what's probably
missing is another call to /etc/init.d/domainname after DHCP has set up
the interface.
-hwh
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-user] Re: "hostname -d" returns no domainname
2006-05-26 9:43 ` [gentoo-user] " Alexander Skwar
@ 2006-05-28 4:04 ` Zac Slade
0 siblings, 0 replies; 11+ messages in thread
From: Zac Slade @ 2006-05-28 4:04 UTC (permalink / raw
To: gentoo-user
On Friday 26 May 2006 04:43, Alexander Skwar wrote:
> I don't think that I can set a "domain entry" in resolv.conf, as it's
> generated by dhcpcd.
The domainname start up script starts before DHCP so yes it would set it. It
doesn't depend on net.
> What does the DNSDOMAIN setting in /etc/conf.d/domainname do?
Here's what it used to do. From my /etc/config-archive/etc/init.d/domainname:
start() {
# Ensure that we have a hostname binary or function
source /lib/rcscripts/net.modules.d/helpers.d/functions
local retval=0
local retval2=0
if checkconfig_nis ; then
ebegin "Setting NIS domainname to ${NISDOMAIN}"
hostname -y "${NISDOMAIN}"
retval=$?
eend ${retval} "Failed to set the NIS domainname"
fi
if checkconfig_dns ; then
ebegin "Setting DNS domainname to ${DNSDOMAIN}"
resolv=$(grep -v '^[[:space:]]*domain' /etc/resolv.conf)
[[ ${OVERRIDE} == "1" ]] \
&& resolv="${resolv}"$'\n'"domain ${DNSDOMAIN}" \
|| resolv="domain ${DNSDOMAIN}"$'\n'"${resolv}"
echo "${resolv}" > /etc/resolv.conf
retval2=$?
eend ${retval2} "Failed to set the DNS domainname"
fi
return $((retval + retval2))
}
${DNSDOMAIN} and ${NISDOMAIN} are read out of /etc/conf.d/domainname earlier
in the script. So it does as I said it did it sets a domain line
in /etc/resolv.conf.
However, this file does not exist in my /etc/init.d anymore. I'm not sure
when that changed or why.
--
Zac Slade
krakrjak@volumehost.net
ICQ:1415282 YM:krakrjak AIM:ttyp99
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-05-28 4:12 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-26 8:09 [gentoo-user] "hostname -d" returns no domainname Alexander Skwar
2006-05-26 8:32 ` Neil Bothwick
2006-05-26 9:43 ` [gentoo-user] " Alexander Skwar
2006-05-28 4:04 ` Zac Slade
2006-05-26 8:46 ` [gentoo-user] " Etaoin Shrdlu
2006-05-26 9:45 ` [gentoo-user] " Alexander Skwar
2006-05-26 10:20 ` [gentoo-user] " Bo Ørsted Andresen
2006-05-26 13:25 ` DNSDOMAIN in /etc/conf.d/domainname has no effect? (was: [gentoo-user] "hostname -d" returns no domainname) Alexander Skwar
2006-05-26 16:00 ` Zac Slade
2006-05-26 17:40 ` [gentoo-user] Re: DNSDOMAIN in /etc/conf.d/domainname has no effect? Alexander Skwar
2006-05-26 19:17 ` Hans-Werner Hilse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox