Bug 73852
Summary: | HOSTALIASES environment variable not used by resolver | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Gordon Messmer <gordon.messmer> | ||||
Component: | glibc | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Brian Brock <bbrock> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 8.0 | CC: | fweimer | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i386 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2002-12-15 22:58:44 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Gordon Messmer
2002-09-12 08:40:32 UTC
Created attachment 75884 [details]
Test case for gethostbyname()
No, the file pointed to by HOSTALIASES is not the same format as /etc/hosts. See http://unixhelp.ed.ac.uk/CGI/man-cgi?hostname+7 Furthermore, it is used only if looking up name which doesn't contain any dots. Having www www.foobar.com in $HOME/hosts and doing HOSTALIASES=$HOME/hosts ./test-gethostbyname www should give you address of www.foobar.com (also note that HOSTALIASES only works for non-suid/sgid apps). #HOSTALIASES is not the same format as /etc/hosts No? I swear I'd used it that way in the past. Removing the contents of that file, and rebuilding it according to the man page you link to causes it to work on release 7.3, but it's not working on (null). $ gcc test-gethostbyname.c -o test-gethostbyname $ echo $HOSTALIASES /home/gordon/root/etc/hosts $ export HOSTALIASES $ ls -l $HOSTALIASES -rw-r--r-- 1 gordon gordon 20 Sep 12 09:36 \ /home/gordon/root/etc/hosts $ cat $HOSTALIASES www www.eburg.com $ host www www.dragonsdawn.net is an alias for phantom.dragonsdawn.net. phantom.dragonsdawn.net has address 63.164.112.5 $ host www.eburg.com www.eburg.com is an alias for naneum.eburg.com. naneum.eburg.com has address 63.164.112.2 $ ./test-gethostbyname www gethostbyname returned 63.164.112.5 Don't know where that line break in the HOSTALIASES file came from (in the above text). I think the text widget put it there. The file is only one line long. Works just fine for me (on glibc-2.2.93-4). Is that available via up2date or rawhide? I'm running glibc-2.2.93-2 |