[SAC] [OSGeo] #644: DNS resolution issue with CURL on AdHoc VM

OSGeo trac_osgeo at osgeo.org
Tue Oct 19 14:51:00 EDT 2010


#644: DNS resolution issue with CURL on AdHoc VM
---------------------------+------------------------------------------------
 Reporter:  dmorissette    |       Owner:  sac@…              
     Type:  defect         |      Status:  new                
 Priority:  normal         |   Milestone:                     
Component:  Systems Admin  |    Keywords:                     
---------------------------+------------------------------------------------
 Some DNS resolution issues with programs using the CURL library have been
 reported on the AdHoc VM recently: CURL is unable to resolve any hostname.
 OTOH, dig on the same hostname does work:

 {{{
 dmorissette at adhoc:/tmp$ curl -v http://www.google.com/
 * getaddrinfo(3) failed for www.google.com:80
 * Couldn't resolve host 'www.google.com'
 * Closing connection #0
 curl: (6) Couldn't resolve host 'www.google.com'

 dmorissette at adhoc:/tmp$ dig www.google.com
 [...]
 ;; ANSWER SECTION:
 www.google.com.         604759  IN      CNAME   www.l.google.com.
 www.l.google.com.       259     IN      A       74.125.155.106
 [...]
 }}}

 Based on a quick web search, it seems that this kind of problem is related
 to the "hosts" setting in the /etc/nsswitch.conf.

 We currently have the following line in /etc/nsswitch.conf:
 {{{
 hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
 }}}

 ... and I verified that if I put "dns" before "mdns4_minimal" then CURL
 works fine:
 {{{
 hosts:          files dns mdns4_minimal [NOTFOUND=return] mdns4
 }}}

 I would also note that I checked two other VMs (projects and backup) and
 none of them has the mdsn4 stuff, only a simple
 {{{
 hosts:          files dns
 }}}
 ... so it seems that someone intentionally changed this in the AdHoc VM
 since it was created.

 Unfortunately I don't know enough about the nsswitch.conf and mdns4 to be
 sure that the proposed fix above won't have other bad side-effects.
 Hopefully whoever added the mdns4 stuff will see this ticket and can
 confirm that the change to put "dns" right after "files" would be fine.

-- 
Ticket URL: <http://trac.osgeo.org/osgeo/ticket/644>
OSGeo <http://www.osgeo.org/>
OSGeo committee and general foundation issue tracker.


More information about the Sac mailing list