bsdperimeter/pfsense — pull request #443 by phildd (2013-02-27 08:49:05+00:00)
Title: Add option to display host name on traffic graph bandwidth by IP table

Need: We are often looking in real-time at which IP seems to be chewing up lots of bandwidth. The traffic graph bandwidth by IP is good for this (with interface set to LAN). Then we want to see "who" the IP is (i.e. the host name - gives a quick clue to a real human about which desk/person is the offender, rather than memorising every IP address). We use DHCP static mappings on pfSense to hand out known IP addresses to all our regular clients on LAN. We also add a few entries to the DNS forwarder hosts for common IT infrastructure items so that the name is there on pfSense even when our main internal DNS server is offline. We end up having the DHCP Server page open as to find the name that goes with the IP address.
Constraints: looking up the name that goes with an IP address has to be fast for a real-time display like this - it can't afford the time to do reverse lookups to a real DNS server, and certainly can't afford to have timeouts for IP addresses that do not have reverse lookup names.
This change allows the user to select "IP Address" or "Host Name" as the display format of the Host column on the bandwidth by IP table.
"IP Address" is the default, and the display works the same as before.
"Host Name" - an array of DNS Forwarder host entries and DHCP static mappings is built, key IP address, data host name. Each IP address that is in the array is replaced by the host name for display. Note: the domain name part is not used - that would usually make the string longer than the column width and in most cases just the host name is all that is needed to quickly identify the client.
Hopefully this is a useful to others.