Network scan fails without -n flag due to DNS resolution timeout #1244
Unanswered
KafCaf
asked this question in
Help wanted
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Of course. Here is a complete, professionally written GitHub issue based on our entire troubleshooting process. You can copy and paste this directly into a new issue on the UpSnap GitHub page.
Issue Title: Network Scan Fails Due to DNS Timeout, Works with
nmap -n
FlagEnvironment
ghcr.io/seriousm4x/upsnap:latest
Problem Description
The UpSnap web interface does not display any discovered devices on the local network. The application starts correctly, and the web server is accessible.Devices can be added manually,but the primary network scanning feature appears to be non-functional, resulting in an empty device list.
Detailed Troubleshooting Steps & Logs
A systematic diagnosis was performed, which successfully isolated the issue to the way
nmap
is being called by the application. The underlying network connectivity from the container to the LAN is fully functional.1. Verified L2 Network Connectivity with
arp-scan
I entered the running container and confirmed that basic Layer 2 ARP scanning works correctly.
Command:
docker exec -it upsnap /bin/sh apk add --no-cache arp-scan arp-scan --localnet
Result: (Success)
arp-scan
successfully and quickly discovered multiple hosts on the LAN (192.168.31.0/24
), proving themacvlan
network is correctly configured and the container has L2 visibility.2. Tested
nmap
without disabling DNS resolutionNext, I tested
nmap
with the same parameters UpSnap likely uses (-sn
). This command failed by hanging indefinitely.Command:
# Inside the container nmap -sn 192.168.31.0/24
Result: (Failure)
The scan got stuck on DNS resolution and eventually would have timed out without finding any hosts.
3. Tested
nmap
WITH DNS resolution disabled (-n
flag)This is the definitive test. By adding the
-n
flag to disable DNS resolution,nmap
works perfectly.Command:
# Inside the container nmap -sn -n 192.168.31.0/24
Result: (Success)
The scan completed quickly and successfully discovered all online hosts, matching the
arp-scan
result.Conclusion & Suggested Solution
The root cause of the network scan failure is that
nmap
is being called without the-n
flag. In typical LAN environments without a local DNS server configured for reverse lookups, this causesnmap
to hang on DNS resolution timeouts, preventing the scan from ever completing successfully.It is highly recommended that UpSnap's internal call to
nmap
for network scanning should use the-n
flag by default to ensure reliable performance on all local networks. Alternatively, this could be exposed as a user-configurable option in the settings.Thank you for your work on this great tool.
Beta Was this translation helpful? Give feedback.
All reactions