I’m currently facing a strange situation here. I’m using pmacct to gather IP traffic on interface green. This command returns local IP addresses instead of host names.
So, some monitoring I need host names as well, hence I’m using a Python script to resolve DNS names, the appropriate line is,
socket.gethostbyaddr(ipaddr) where ipaddr is one of my local IP adddreses here.
I’m running DNS on my IPFire as well as a second DNS on my Synology NAS. The later is needed because of the running Active Directory Server on the NAS.
Now what is strange? The above line sometimes returns different host names for a few IP addresses, mainly if not always for connected smartphone.
The host themselves, however, are correct in a certain way: E.g 192.168.23.3 returns SamsungS5 as well as HandySamsungS5. When doing some traffic statistics, I cannot use different host names, I need unique ones.
OK, some further details: the host name HandySamsungS5 is set up by the HOST file on my IPFire, using the WebIF, whereas SamsungS5 is not used anywhere. The IP address 192.168.23.3 is a static one and configured in DHCP server on IPFire.
Do you know the source of this varying host names. I cannot say for sure when this happens. Since those smartphones are randomly connected via a Wifi AP the time for this occurrence cannot be determined.