Skip to content

Sends notifications (gotify) to your phone about new unknown hosts in dnsmasq log

License

Notifications You must be signed in to change notification settings

MahouShoujoMivutilde/dnsmasq-lease-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

dnsmasq-lease-notifier

Is a script for dnsmasq's --dhcp-script option. Its purpose is to notify you via gotify if some unknown (that is, not in /etc/hosts or dhcp-host) host requests an ip in your network. Can be easily edited to deliver notifications over something else, e.g. apprise.

Dependencies:

Options:

The script is quite short, so i expect you to edit it appropriately if needed.

Points of interest:

DNS_LEASE_WATCHER_OUI_DB

This is a path to the copy of https://standards-oui.ieee.org/oui/oui.txt, defaults to /usr/local/share/oui.txt

curl -L 'https://standards-oui.ieee.org/oui/oui.txt' | sudo tee /usr/local/share/oui.txt

DNS_LEASE_WATCHER_NMAP_DB

Defaults to /usr/share/nmap/nmap-mac-prefixes

If both present, oui.txt is preferred since it should be more up to date.

Setup

Download and install the script

curl -L \
  'https://raw.githubusercontent.com/MahouShoujoMivutilde/dnsmasq-lease-notifier/master/dnsmasq-lease-notifier.sh' |
  sudo tee /usr/local/bin/dnsmasq-lease-notifier.sh

Add

dhcp-script=/usr/local/bin/dnsmasq-lease-notifier.sh

to /etc/dnsmasq.conf

Mobile notifications

In short:

  1. setup gotify/server somewhere
  2. in its webui create dnsmasq watcher app for your user, get its auth token
  3. setup gotify/cli with said token on your dnsmasq server
  4. login in gotify on your phone

About

Sends notifications (gotify) to your phone about new unknown hosts in dnsmasq log

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages