DNS not working over modem connection

Hi all,

I am seeing a problem with our design where DNS is not working in Torizon when only the modem is connected. I thought that TOR-1329 might solve the problem so we updated to 5.2 today however the issue is still present.

We are using a Telit ME910-WW modem connected over USB. We use PPPD, and ModemManager is disabled as this allows us to use the advanced features of the modem to control the connection better.

In summary:

  • Ethernet only - works as normal

  • Ethernet and modem connected - modem is default route, DNS works and pings travel over modem connection

  • Modem only - pings to IP addresses work but DNS does not work, lookup fails

  • Modem only - can perform DNS lookup when I talk to it with AT commands and I can see it has correctly received the nameservers for google

  • Modem only - When I specify the nameserver to use with nslookup it does work

    nslookup telit.com 8.8.8.8

This makes me think the default name servers are not switching over correctly when the modem PPP connection comes up even though the modem is the default route.

A few questions from me:

  1. What was changed in TOR-1329 and should it have resolved this issue?
  2. Is there a way to manually update the DNS servers when using the modem?
  3. Is there a way I can check what DNS servers Torizon thinks it is using? (I can see the PPPD ones are correct)

All suggestions very welcome.

Hi edwaugh,

It seems for some reason your modem connection is not populating the default DNS entries in /etc/resolv.conf.

  1. What was changed in TOR-1329 and should it have resolved this issue? No, this is a different issue. See that the ticket was related to TorizonCore Builder.

  2. Is there a way to manually update the DNS servers when using the modem? Yes. Can you please check if adding FallbackDNS entries in /etc/systemd/resolved.conf solves the issue?

  3. Is there a way I can check what DNS servers Torizon thinks it is using? (I can see the PPPD ones are correct). Usually /etc/resolv.conf is populated, so you can list this file.

Let me know if that helps.

Best regards,

Sergio Prado - TorizonCore Team Lead

Hi @sergio.tx,

Thanks for the response.
Yeah the PPPD default dnssetup scripts do not populate the correct resolv.conf which is the problem in this case.

I am just wondering what is the best way to populate the resolv.conf now. I see that when the Ethernet interface is brought down, the dnsserver entry in the resolv changes. So I would configure the pppd scripts to also update the resolv.conf similarly.

Do you know which part is responsible to update the resolv.conf for the existing ethernet interfaces?
I would expect the NetworkManager does this. Is that correct?

Regards,
Gaurav

Hi Guarav,

I think it’s usually handled by systemd-resolved. You can get lots of info using systemd-resolve --status. I’m not sure how NetworkManager fits in. I know that it can update resolv.conf but even on my ubuntu desktop, which is definitely using NetworkManager, the /etc/resolv.conf file is a symlink to /var/run/systemd/resolve/stub-resolv.conf.

Drew

Hi Gaurav,

I would suggest not writing directly to /etc/resolv.conf. Because systemd-resolved could remove your configuration at any time.

I think if you set a FallbackDNS entry in /etc/systemd/resolved.conf, it will be used in case resolv.conf is not populated. Can you try that?

Sergio Prado - TorizonCore Team Lead

Thank Drew,

I used the resolvectl to see what was happening.

The PPP ip-up and ip-down helper scripts were modifying the wrong resolv.conf in the system because of which the DNS resolution with PPP interface failed.

I have fixed them and now it works.

Hi Sergio,

Updating the /etc/resolv.conf directly doesn’t work. As you said the systemd-resolved service rewrites any changes done to this.

So I read a bit about it and now just updated the existing ppp helper scripts to link the /etc/resolv.conf to a resolv.conf managed by pppd. The This /etc/resolv.conf is still monitored by the systemd-resolved and it merges the existing and new configuration automatically.
This is one of the operating mode for the systemd-resolved described in the man page so I think this should be fine.

While removing the ppp interface, pppd restores the link for /etc/resolv.conf to the existing resolv.conf link which is managed by the systemd-resolved.

Thanks for the pointers.

Regards,
Gaurav

Hi @gauravks, confirmed this is working, well done!

Good to know that it’s now working.

Thanks for the support @sergio.tx and @drew.tx.

Good to know!