openwrt / openwrt/packages

<inotify-tools> Inotifywait breaks DNS (sort of..)

Open
#25,622 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

release/23.05 release/24.10
Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

Maintainer: @dangowrt - Daniel Golle daniel@makrotopia.org
Environment: X86-64 - Both 23.05.5 and 24.10-RC4

Description:

Very strange issue here. inotify running on a router serving as DNS server.
If i nslookup a local name from CLI, it correclty resolves through the local DNS server.
If i nslookup the very same name inside a inotify pipe or loop, the query is sent to the WAN dns server failing.

Sample script:

#!/bin/sh
echo "Resolving out of the loop"
nslookup accesspoint.lan
echo "Looping"
inotifywait -m /tmp/dhcp.leases -e delete,close_write,move | 
 while read action; do
  nslookup accesspoint.lan
 done

Sample output

Resolving out of the loop
Server:         127.0.0.1
Address:        127.0.0.1:53
Name:   accesspoint.lan
Address: 192.168.1.2
Non-authoritative answer:
Looping
Setting up watches.
Watches established.
Server:         2001:4860:4860::8888
Address:        [2001:4860:4860::8888]:53
** server can't find accesspoint.lan: NXDOMAIN
** server can't find accesspoint.lan: NXDOMAIN

as you can see the first nslookup correctly uses the local DNS server, but the second uses directly the google ipv6 DNS server (that is the server setup for my WAN connection)

i honestly have no idea
thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the sample shell pipeline using /tmp/dhcp.leases, inotifywait, and nslookup on the listed OpenWrt versions. Compare resolver behavior before and inside the loop, then trace the interaction between inotify-tools and DNS; done means the cause is identified and local lookups behave consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.