Hi All,
I’m trying to use curl (as per the sample on github) to get some data from Legato to a https site. There’s something weird going on with the way that the DNS look-up is being done inside my Legato app.
Legato 16.10.1 (it’s a FX30 and that’s the latest available at the moment); eth0 is set up to have a non-routable IP address but not plugged into any network; connection via USB; and a SIM card in and connected to the network (manually using CM data connect) and cm data returns that the network is connected.
I don’t think it’s curl on the WP, as I’ve used tcpdump to monitor traffic on port 53 (dns).
When I use curl from command line, the command completes sucessfully. tcpdump reports:
07:27:21.040890 IP 100.71.231.xxx.35965 > google-public-dns-a.google.com.domain: 42855+ A? www.example.com.au. (51)
07:27:21.041958 IP 100.71.231.xxx.35965 > google-public-dns-a.google.com.domain: 31148+ AAAA? www.example.com.au. (51)
07:27:21.945178 IP 100.71.231.xxx.56804 > google-public-dns-a.google.com.domain: 63014+ PTR? xxx.231.71.100.in-addr.arpa. (45)
07:27:22.576309 IP google-public-dns-a.google.com.domain > 100.71.231.xxx.35965: 42855 1/0/0 A 103.229.49.xx (67)
07:27:22.736327 IP google-public-dns-a.google.com.domain > 100.71.231.xxx.35965: 31148 0/1/0 (127)
07:27:22.785679 IP google-public-dns-a.google.com.domain > 100.71.231.xxx.56804: 63014 NXDomain 0/1/0 (102)
07:27:22.787205 IP 100.71.231.xxx.33975 > google-public-dns-a.google.com.domain: 43778+ PTR? 8.8.8.8.in-addr.arpa. (38)
07:27:23.845743 IP google-public-dns-a.google.com.domain > 100.71.231.xxx.33975: 43778 1/0/0 PTR google-public-dns-a.google.com. (82)
When I run curl from my app using libcurl as per the sample, curl fails with a ‘unable to resolve’ error. tcpdump reports:
05:39:53.369138 IP localhost.localdomain.41887 > localhost.localdomain.domain: 2730+ A? www.example.com.au. (51)
05:39:53.369565 IP localhost.localdomain.41887 > localhost.localdomain.domain: 31712+ AAAA? www.example.com.au. (51)
05:39:58.374082 IP localhost.localdomain.41887 > localhost.localdomain.domain: 2730+ A? www.example.com.au. (51)
05:39:58.374418 IP localhost.localdomain.41887 > localhost.localdomain.domain: 31712+ AAAA? www.example.com.au. (51)
05:40:03.376432 IP localhost.localdomain.54734 > localhost.localdomain.domain: 1008+ A? www.example.com.au. (51)
05:40:03.376768 IP localhost.localdomain.54734 > localhost.localdomain.domain: 35839+ AAAA? www.example.com.au. (51)
05:40:08.382292 IP localhost.localdomain.54734 > localhost.localdomain.domain: 1008+ A? www.example.com.au. (51)
05:40:08.382628 IP localhost.localdomain.54734 > localhost.localdomain.domain: 35839+ AAAA? www.example.com.au. (51)
So it looks like the DNS resolver is not doing the correct thing for the legato app.
As per the sample, I’ve made sure that the hosts file, resolve.conf etc are copied into the app via the ‘require’ mechanism. I’ve also looked in the /legato/current/… directory while my app has been running and can see that the files have been copied across and appear to be the same as those in the main filesystem.
I’m using the google DNS resolvers - 8.8.8.8 and 8.8.4.4 are listed in /etc/resolve.conf
Note: I’m not using the ‘data connection’ api in my Legato app, but I am certain that the network is connected and working as I can test it from the command line.
Any thoughts? I get on a plane on Sunday night to demo to clients Monday/Tuesday next week.
ciao