zimakki

zimakki

I’m running a setup where my device connects to the internet via a modem, and I’m frequently encountering the following error:


{:error, :nxdomain}

I suspect that the default DNS server being used is too slow or unreliable. As a simple fix, I’d like to manually set a faster DNS server, such as 1.1.1.1 (Cloudflare) or 8.8.8.8 (Google). However, I haven’t been able to figure out how to configure this for my modem connection.

If that doesn’t solve the issue, I assume I’ll need to look into caching DNS responses somehow.

System Details

  • Hardware: Raspberry Pi Zero 2 W running Nerves
  • Modem: Quectel BG96 connected to the Pi via USB
  • Networking: Using VintageNetQmi to communicate with the modem
  • Connections:
    • The Pi connects via the modem and WebSockets to Nerves Cloud
    • The Pi connects via the modem and WebSockets to my Phoenix server

Configuration Details

This is the configuration I’m using to set it up:

{"wwan0",
 %{
   type: VintageNetQMI,
   vintage_net_qmi: %{
     only_radio_technologies: [:lte],
     service_providers: [
       %{apn: "m2m.movistar.es"},
       %{apn: "eapn1.net"}
     ]
   },
   ipv4: %{
     method: :dhcp,
     name_servers: ["1.1.1.1", "8.8.8.8", "9.9.9.9"]
   }
 }}

When I run VintageNet.info, I see the following output for the wwan0 interface:

Interface wwan0
  Type: VintageNetQMI
  Present: true
  State: :configured (1:31:35)
  Connection: :internet (1:31:14)
  Addresses: 100.106.199.53/30, fe80::bb8b:1609:7dc4:e54e/64
  MAC Address: nil
  Configuration:
    %{
      type: VintageNetQMI,
      ipv4: %{
        method: :dhcp,
        dhcpd: %{options: %{dns: ["1.1.1.1", "8.8.8.8", "9.9.9.9"]}}
      },
      vintage_net_qmi: %{
        service_providers: [%{apn: "m2m.movistar.es"}, %{apn: "eapn1.net"}],
        only_radio_technologies: [:lte]
      }
    }

However, when I check the system’s resolver configuration (using cat /etc/resolv.conf), it shows:

# This file is managed by VintageNet. Do not edit.

nameserver 10.4.0.240 # From wwan0
nameserver 10.4.0.230 # From wwan0
nameserver 10.144.21.239 # From wlan0

I don’t actually know if my DNS settings have taken effect.

Additional Context

• The device works much more reliably on Wi-Fi, likely due to the higher speeds, but I can’t rely on Wi-Fi since the device will be using the modem in the field.

• The issue varies over time—sometimes it works fine, and other times I get persistent NXDOMAIN errors.

• Both my Phoenix server and Nerves Cloud seem equally affected, though it’s hard to confirm since when I lose access to Nerves Cloud, I can’t troubleshoot further.

My Questions

  1. How can I manually configure a faster DNS server for this setup? I tried setting it in the config, but it doesn’t seem to be applied in /etc/resolv.conf.

  2. If that doesn’t work, what are some good strategies for DNS caching to improve reliability?

  3. Has anyone encountered {:error, :nxdomain} when using VintageNetQmi with a Quectel BG96 modem?

  4. Are there any additional debugging steps I can take to confirm whether the issue is strictly DNS-related or if it might be something else?

Any advice would be greatly appreciated!

Showing Posts 1 to 4

amclain

amclain

nxdomain is a system error that means the DNS server could not be reached. Since you said the issue is intermittent and both Phoenix and Nerves Cloud are also affected, it sounds like you may be in a location with poor cell signal. You can find the signal strength (signal_dbm) with VintageNet.info. The less negative the number, the better. Some ways to mitigate this in development are:

  • Repositioning the antenna for development
  • Using a better antenna for development (passive gain)
  • Adding a cellular signal booster to the area

If you change the antenna in production though, you’ll need to go through compliance again.

Since the BG96 is both CAT-M and NB-IOT, you could also check the manual on how to disable NB-IOT for this modem since it is painfully slow for typical Nerves systems. That way the modem will only connect via CAT-M.

And since you asked, if you need to add name servers, the VintageNet property is additional_name_servers.

D4no0

D4no0

Is this kind of thing legal?

amclain

amclain

Yes, cell boosters are legal (in the US). Active jamming is illegal. HiBoost makes residential ones, and large commercial buildings these days have some pretty fancy ones installed.

amclain

amclain

You can also use ping to troubleshoot connectivity. Try pinging the DNS servers, google.com, your cloud server, and even the network gateway’s IP address (find with ifconfig). This will show you latency and dropped packets.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

webofbits
Cairn is a small OTP library for message delivery, lightweight function processes, supervised work, and waiting on results. The goal is ...
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews