Is there a way to specify the DNS used by http_client? #460
-
Since 7.0 dropped, local playback is now restricted to talking to a port. In a Docker setup where both myMPD and MPD are containerised (in separate containers and connected to the same bridge network) myMPD is able to talk to MPD by resolving "mpd", the same as what you set as comtainer_name for the MPD container. Docker embeds itself as the DNS server within the network, resolving container names so containers can talk to each other. http_client, however, complains that it cannot find a DNS server, and defaults to Google's:
which results in Mongoose failing to setup local playback:
This is odd, since myMPD itself successfully connects to MPD by resolving "mpd" --- mpd_host is set as "mpd". (Cannot use socket since when containerised, MPD fails at binding to a socket.) There is a DNS server defined in /etc/resolv.conf:
So it seems http_client somehow cannot see this...? As a temporary fix, is it possible for the user to define the DNS used by http_client? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There is no way to configure a dns server for myMPD. myMPD uses In musl, the Libmpdclient uses Problem will be fixed for the 7.0.1 version: #461 |
Beta Was this translation helpful? Give feedback.
There is no way to configure a dns server for myMPD.
myMPD uses
res_init()
to get the nameserver from resolv.conf. This is working for gnu libc, but not for musl. The docker container is based on Alpine Linux.In musl, the
res_init()
function looks like: http://git.musl-libc.org/cgit/musl/tree/src/network/res_init.c. Therefore myMPD finds no dns server. Mongoose as http client library uses his own dns client implementation to resolve names asynchronously and depends on the configured dns server.Libmpdclient uses
getaddrinfo
to resolve host names and not depends on a workingres_init()
function.Problem will be fixed for the 7.0.1 version: #461