mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
Reverse DNS docs + NEW status priority #549
This commit is contained in:
2
.github/workflows/docker_cache-cleaner.yml
vendored
2
.github/workflows/docker_cache-cleaner.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: ci-package-cleaner
|
name: 🤖Automation - ci-package-cleaner
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/update_sponsors_table.yml
vendored
2
.github/workflows/update_sponsors_table.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Update Sponsors Table
|
name: 🤖Automation - Update Sponsors Table
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
|
|||||||
@@ -94,7 +94,9 @@ Get visibility of what's going on on your WIFI/LAN network. Scan for devices, po
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
### ⭐ Sponsors
|
### ⭐ Sponsors (Work in progress)
|
||||||
|
|
||||||
|
[](https://github.com/sponsors/jokob-sk)
|
||||||
|
|
||||||
Thank you to all the wonderful people who have sponsored this project (=prevented my burnout):
|
Thank you to all the wonderful people who have sponsored this project (=prevented my burnout):
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,14 @@ There is also an in-app Help / FAQ section that should be answering frequently a
|
|||||||
|
|
||||||
### 📚 Table of contents
|
### 📚 Table of contents
|
||||||
|
|
||||||
|
#### 📥 Initial Setup
|
||||||
|
|
||||||
|
- [Subnets and VLANs configuration for arp-scan](/docs/SUBNETS.md)
|
||||||
|
- [SMTP server config](/docs/SMTP.md)
|
||||||
|
- [Custom Icon configuration and support](/docs/ICONS.md)
|
||||||
|
- [Better name resolution with Reverse DNS](/docs/REVERSE_DNS.md)
|
||||||
|
- [Network treemap configuration](/docs/NETWORK_TREE.md)
|
||||||
|
|
||||||
#### 🐛 Debugging help & tips
|
#### 🐛 Debugging help & tips
|
||||||
|
|
||||||
- [Debugging tips](/docs/DEBUG_TIPS.md)
|
- [Debugging tips](/docs/DEBUG_TIPS.md)
|
||||||
@@ -33,9 +41,6 @@ There is also an in-app Help / FAQ section that should be answering frequently a
|
|||||||
|
|
||||||
#### 🔝 Popular/Suggested
|
#### 🔝 Popular/Suggested
|
||||||
|
|
||||||
- [Network treemap configuration](/docs/NETWORK_TREE.md)
|
|
||||||
- [SMTP server config](/docs/SMTP.md)
|
|
||||||
- [Subnets and VLANs configuration for arp-scan](/docs/SUBNETS.md)
|
|
||||||
- [Home Assistant](/docs/HOME_ASSISTANT.md)
|
- [Home Assistant](/docs/HOME_ASSISTANT.md)
|
||||||
- [Bulk edit devices](/docs/DEVICES_BULK_EDITING.md)
|
- [Bulk edit devices](/docs/DEVICES_BULK_EDITING.md)
|
||||||
|
|
||||||
@@ -43,7 +48,7 @@ There is also an in-app Help / FAQ section that should be answering frequently a
|
|||||||
|
|
||||||
- [Manage devices (legacy docs)](/docs/DEVICE_MANAGEMENT.md)
|
- [Manage devices (legacy docs)](/docs/DEVICE_MANAGEMENT.md)
|
||||||
- [Random MAC/MAC icon meaning (legacy docs)](/docs/RANDOM_MAC.md)
|
- [Random MAC/MAC icon meaning (legacy docs)](/docs/RANDOM_MAC.md)
|
||||||
- [Custom Icon configuration and support](/docs/ICONS.md)
|
|
||||||
|
|
||||||
#### 🔎 Examples
|
#### 🔎 Examples
|
||||||
|
|
||||||
|
|||||||
27
docs/REVERSE_DNS.md
Executable file
27
docs/REVERSE_DNS.md
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
## Setting up better name discovery with Reverse DNS
|
||||||
|
|
||||||
|
If you are running a DNS server, such as AdGuard, set up **Private reverse DNS servers** for a better name resolution on your network. Enabling this setting will enable PiAlert to execute dig and nslookup comamnds to automatically resolve device names based on their IP addresses.
|
||||||
|
|
||||||
|
> Example 1: Reverse DNS `disabled`
|
||||||
|
>
|
||||||
|
> ```
|
||||||
|
> jokob@Synology-NAS:/$ nslookup 192.168.1.58
|
||||||
|
> ** server can't find 58.1.168.192.in-addr.arpa: NXDOMAIN
|
||||||
|
>
|
||||||
|
> ```
|
||||||
|
|
||||||
|
> Example 2: Reverse DNS `enabled`
|
||||||
|
>
|
||||||
|
> ```
|
||||||
|
> jokob@Synology-NAS:/$ nslookup 192.168.1.58
|
||||||
|
> 45.1.168.192.in-addr.arpa name = jokob-NUC.localdomain.
|
||||||
|
> ```
|
||||||
|
|
||||||
|
### Enabling reverse DNS in AdGuard
|
||||||
|
|
||||||
|
1. Navigate to **Settings** -> **DNS Settings**
|
||||||
|
2. Locate **Private reverse DNS servers**
|
||||||
|
3. Enter your router IP address, such as `192.168.1.1`
|
||||||
|
4. Make sure you have **Use private reverse DNS resolvers** ticked.
|
||||||
|
5. Click **Apply** to save your settings.
|
||||||
|
|
||||||
@@ -343,28 +343,29 @@ function filterDataByStatus(data, status) {
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function getDeviceStatus(item)
|
function getDeviceStatus(item)
|
||||||
{
|
{
|
||||||
if(item.dev_PresentLastScan === 1)
|
|
||||||
{
|
if(item.dev_NewDevice === 1)
|
||||||
return 'On-line';
|
{
|
||||||
}
|
return 'New';
|
||||||
else if(item.dev_PresentLastScan === 0 && item.dev_AlertDeviceDown !== 0)
|
}
|
||||||
{
|
else if(item.dev_PresentLastScan === 1)
|
||||||
return 'Down';
|
{
|
||||||
}
|
return 'On-line';
|
||||||
else if(item.dev_NewDevice === 1)
|
}
|
||||||
{
|
else if(item.dev_PresentLastScan === 0 && item.dev_AlertDeviceDown !== 0)
|
||||||
return 'New';
|
{
|
||||||
}
|
return 'Down';
|
||||||
else if(item.dev_Archived === 1)
|
}
|
||||||
{
|
else if(item.dev_Archived === 1)
|
||||||
return 'Archived';
|
{
|
||||||
}
|
return 'Archived';
|
||||||
else if(item.dev_PresentLastScan === 0)
|
}
|
||||||
{
|
else if(item.dev_PresentLastScan === 0)
|
||||||
return 'Off-line';
|
{
|
||||||
}
|
return 'Off-line';
|
||||||
|
}
|
||||||
|
|
||||||
return "Unknown status"
|
return "Unknown status"
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ def main():
|
|||||||
# Retrieve devices
|
# Retrieve devices
|
||||||
unknown_devices = device_handler.getUnknown()
|
unknown_devices = device_handler.getUnknown()
|
||||||
|
|
||||||
|
mylog('verbose', [f'[{pluginName}] Unknown devices count: {len(unknown_devices)}'])
|
||||||
|
|
||||||
for device in unknown_devices:
|
for device in unknown_devices:
|
||||||
domain_name, dns_server = execute_nslookup(device['dev_LastIP'], timeout)
|
domain_name, dns_server = execute_nslookup(device['dev_LastIP'], timeout)
|
||||||
|
|
||||||
@@ -95,9 +97,10 @@ def execute_nslookup (ip, timeout):
|
|||||||
|
|
||||||
mylog('verbose', [f'[{pluginName}] DEBUG OUTPUT : {output}'])
|
mylog('verbose', [f'[{pluginName}] DEBUG OUTPUT : {output}'])
|
||||||
|
|
||||||
# Parse output using regular expressions
|
# Parse output using case-insensitive regular expressions
|
||||||
domain_pattern = re.compile(r'Name:\s+(.+)')
|
domain_pattern = re.compile(r'name\s*=\s*([^\s]+)', re.IGNORECASE)
|
||||||
server_pattern = re.compile(r'Server:\s+(.+)')
|
server_pattern = re.compile(r'Server:\s+(.+)', re.IGNORECASE)
|
||||||
|
|
||||||
|
|
||||||
domain_match = domain_pattern.search(output)
|
domain_match = domain_pattern.search(output)
|
||||||
server_match = server_pattern.search(output)
|
server_match = server_pattern.search(output)
|
||||||
|
|||||||
Reference in New Issue
Block a user