RFC 2782 says:
A SRV-cognizant client SHOULD use this procedure to locate a list of servers and connect to the preferred one:
Do a lookup for QNAME=_service._protocol.target, QCLASS=IN, QTYPE=SRV.
If the reply is NOERROR, ANCOUNT>0 and there is at least one SRV RR which specifies the requested Service and Protocol in the reply:
[...]
else
Do a lookup for QNAME=target, QCLASS=IN, QTYPE=A
So our workaround is right, but GLib probably shouldn't be failing with such a nonspecific error: it should just go for the A record itself.
RFC 2782 says:
A SRV-cognizant client SHOULD use this procedure to locate a list of
servers and connect to the preferred one:
Do a lookup for QNAME=_ service. _protocol. target, QCLASS=IN,
QTYPE=SRV.
If the reply is NOERROR, ANCOUNT>0 and there is at least one
SRV RR which specifies the requested Service and Protocol in
the reply:
[...]
else
Do a lookup for QNAME=target, QCLASS=IN, QTYPE=A
So our workaround is right, but GLib probably shouldn't be failing with such a nonspecific error: it should just go for the A record itself.