mailing list of musl libc
 help / color / mirror / code / Atom feed
From: John Mudd <johnbmudd@gmail.com>
To: musl <musl@lists.openwall.com>
Subject: gethostbyname and resolv.conf
Date: Wed, 30 Apr 2014 12:02:17 -0400	[thread overview]
Message-ID: <CAGDMk9HrMyoE-4r1QUQ046pEqn_ndXVFv=46-=VSDUiK2UqhZA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

FYI: Looks like the musl gethostbyname() doesn't use the "search" command
in the resolv.conf file.


$ cat test_gethostbyname.c
#include <stdio.h>
#include <netdb.h>

int main(int argc, char *argv[])
{
    struct hostent *lh = gethostbyname(argv[1]);

    if (lh)
        puts(lh->h_name);
    else
        herror("gethostbyname");

    return 0;
}
$


$ make  test_gethostbyname
gcc     test_gethostbyname.c   -o test_gethostbyname
$ test_gethostbyname lifeline.rx30.com
lifeline.rx30.com
$ test_gethostbyname lifeline
lifeline.rx30.com
$


$ make  test_gethostbyname
musl-gcc -fno-stack-protector    test_gethostbyname.c   -o
test_gethostbyname
$ test_gethostbyname lifeline.rx30.com
lifeline.rx30.com
$ test_gethostbyname lifeline
gethostbyname: Non-recoverable error
$


$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by
resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
search rx30.com
$

[-- Attachment #2: Type: text/html, Size: 1824 bytes --]

             reply	other threads:[~2014-04-30 16:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 16:02 John Mudd [this message]
2014-04-30 16:12 ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGDMk9HrMyoE-4r1QUQ046pEqn_ndXVFv=46-=VSDUiK2UqhZA@mail.gmail.com' \
    --to=johnbmudd@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).