Zoltan Papp be8ec8e802 Fix DoT, keep the tunnel resolver when Private DNS is in Automatic mode (#266)
* Keep the tunnel resolver when Private DNS is in Automatic mode

The tunnel builder left the NetBird resolver out of the VPN whenever
Android reported Private DNS as active. That flag is also true in
Automatic mode on any network whose own resolver speaks TLS, which on
many carriers and some home networks is the default state. NetBird names
and custom DNS zones then stopped resolving with no visible reason, and
whether they worked at all depended on the network the phone was on at
the moment the tunnel was last rebuilt.

Only a configured Private DNS hostname actually conflicts with a plain
resolver in the tunnel: the OS then sends every query over TLS to that
host and refuses plain DNS, so offering our resolver would make every
lookup fail. In Automatic mode the OS probes a resolver for TLS and
falls back to plain DNS when the probe fails, and with Private DNS off
it never asks. In both cases the tunnel resolver works.

Decide on the hostname instead. DNSWatch now reads the Private DNS
server name next to the active flag, and IFace leaves the resolver out
only when one is set, logging which host it yields to. The hostname
setting is global, so the decision no longer depends on which network
happens to be active during a rebuild.

* Make the Private DNS resolver decision a testable function

The previous commit switched the tunnel resolver decision from the
Private DNS active flag to the configured hostname, which left the flag
with no reader. Drop the field, its getter and both assignments.

The decision itself now lives in a static function on DNSWatch that
takes only the hostname, so it can be unit tested without a
ConnectivityManager. IFace calls it directly and isPrivateDnsStrict goes
away. A null or empty name keeps the resolver; a hostname leaves it out.

The message logged when the resolver is left out drops from info to
debug, matching the level of the line it replaced.
2026-09-15 10:39:54 +02:00
2025-06-05 20:37:51 +02:00
2025-06-05 20:37:51 +02:00
2025-11-21 15:33:42 +01:00
2024-02-28 19:21:08 +01:00
2025-06-05 20:37:51 +02:00
2025-06-05 20:37:51 +02:00
2025-06-05 20:37:51 +02:00
2024-02-28 19:21:08 +01:00


Start using NetBird at netbird.io
See Documentation
Join our Slack channel


NetBird Android client

The NetBird Android client allows connections from mobile devices running Android to private resources in the NetBird network.

Screenshots

mainscreen peer-overview peer-detail

Install

You can download and install the app from the Google Play Store:

Get it on Google Play

Building from source

Requirements

We need the following software:

  • Java 1.11. Usually comes with Android Studio
  • android studio initialized with jdk and emulator (not covered here, is a req from android-client project)
  • gradle (https://gradle.org/install/)

Prepare development environment

  1. Close all repositories:

assuming you use a path like ~/projects locally

mkdir ~/projects
cd projects
# clone netbird repo
git clone --recurse-submodules git@github.com:netbirdio/android-client.git
  1. Checkout the repositories to the branches you want to test. If you want the latest, check the status information on your IDE or on https://github.com and verify the branch list and commit history.
  2. Export JDK and Android home vars, on macOS they are: (please contribute with Linux equivalent)
# replace <USERNAME> with your name
export ANDROID_HOME=/Users/<USERNAME>/Library/Android/sdk
export JAVA_HOME=/Applications/Android Studio.app/Contents/jbr/Contents/Home
  1. Install NDK and CMake
cd ~/projects/android-client
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "ndk;23.1.7779620"

Generate debug bundle

Follow the steps to run locally until the step 5 then run the following steps:

  1. Build Go agent library
cd ~/projects/android-client
./build-android-lib.sh
  1. Run gradlew
cd ~/projects/android-client/android
./gradlew bundleDebug  -PversionCode=123 -PversionName=1.2.3
Languages
Java 96.8%
HTML 1.5%
CSS 1%
Shell 0.7%