This is the mail archive of the
mailing list for the glibc project.
[Bug network/19369] New: Default domain name not reset by res_ninit when "search" / "domain" entry is removed from resolv.conf
- From: "rob at robwu dot nl" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 16 Dec 2015 11:37:56 +0000
- Subject: [Bug network/19369] New: Default domain name not reset by res_ninit when "search" / "domain" entry is removed from resolv.conf
- Auto-submitted: auto-generated
Bug ID: 19369
Summary: Default domain name not reset by res_ninit when
"search" / "domain" entry is removed from resolv.conf
Assignee: rob at robwu dot nl
Reporter: rob at robwu dot nl
Target Milestone: ---
Created attachment 8850
Repeatedly uses res_ninit, getaddrinfo, res_nclose.
When I call res_ninit(&_res), I expect resolver functions such as getaddrinfo
to use exactly the same configuration as if the program was run for the first
time (which then uses /etc/resolv.conf).
This is not the case for the "search" (or "domain") entries. When the "domain"
entry is removed, the resolver still uses the previously configured domain
Steps to reproduce:
1. Compile the attached program (gcc -Wall getaddr.c). This program repeatedly
calls res_ninit, getaddrinfo("www", ...), res_nclose.
2. Edit /etc/resolv.conf, add "search example.com"
3. Run ./a.out www
4. Edit /etc/resolv.conf, remove "search example.com"
5. Run ./a.out www
At step 3, the following is output (because "www" -> "www.example.com", which
getaddrinfo("www") = 0
At step 5, the following should be output (or anything else that is not
"www.example.com", -2 = EAI_NONAME):
getaddrinfo("www") = -2
At step 5, the same result as step 3 is shown, which indicates that the default
domain suffix is not reset.
You are receiving this mail because:
You are on the CC list for the bug.