• SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Curl dns resolving not working (entware)

  • Thread starter Thread starter krabs
  • Start date Start date
K

krabs

Guest
Curl dns resolving (entware) is not working for me. (stucks)
It does however works when given up an IP adres instead of an remote domain name.
Maybe it's related to the fact that I'm also running dnscrypt-proxy(entware 127.0.0.1:65053) on my rt-ac66u.
Specifying the dns-server as option returns an error: curl: (4) Error (possible feature not enabeled)


Someone any advice to get dns resolving working without rebuilding libcurl ?
 
Have you tried curl with -4 option?

Well you just solved my problem. :)
From the man pages
Code:
4, --ipv4
If curl is capable of resolving an address to multiple IP versions (which it is if it is IPv6-capable), this option tells curl to resolve names to IPv4 addresses only.
I do not understand why it's needed as I'm using only ipv4 but it just works now.:D
 
Well you just solved my problem. :)
From the man pages
Code:
4, --ipv4
If curl is capable of resolving an address to multiple IP versions (which it is if it is IPv6-capable), this option tells curl to resolve names to IPv4 addresses only.
I do not understand why it's needed as I'm using only ipv4 but it just works now.:D

I remember ryzhov_al mentionned something in the past concerning IPv6 resolution and Entware. Try to search the forums here to track down his post, I don't remember the details.
 
Here is example
Code:
# nslookup www.marxists.org
Server:    127.0.0.1
Address 1: 127.0.0.1 localhost.localdomain

Name:      www.marxists.org
Address 1: 2607:f358:1a:b::2 luxemburg.marxists.org
Address 2: 72.13.82.90 luxemburg.marxists.org
IPv6 address resolves first. You don't have IPv6 enabled. Curl stucks ;)
 
krabs, wl500g != RMerlin
It's different firmware. Not sure about /tmp/etc/gai.conf support or similar in Asuswrt-Merlin
 
krabs, wl500g != RMerlin
It's different firmware. Not sure about /tmp/etc/gai.conf support or similar in Asuswrt-Merlin

You're 100% right it's for sure a different firmware but it has nothing to do with merlin but entware !

Entware uClibc has support for it.
curl uses entware library uclibc

Code:
ldd curl
ld-uClibc.so.0 => /opt/lib/ld-uClibc.so.0 (0x2aaa8000)

now when executing curl google.be it just resolves fine.

It doesn't work for nslookup (merlin busybox) because it's using the standard uclibc library in /lib

Code:
ldd nslookup
ld-uClibc.so.0 => /lib/ld-uClibc.so.0

I was searching for replacing/linking (temporaly) with ldconfig /lib/ld-uClibc.so.0 to /opt/lib/ld-uClibc.so.0 for nslookup but this isn't possible (without recompiling I think)

An easier method is installing nslookup (busybox) from entware.
Code:
ldd /opt/bin/nslookup

This one use is using enware's ld-uClibc.so.0 library
Now ipv4 resolves first if gai.conf is created with precedence ipv4.
Otherwise Ipv6 resolves first.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top