Page 1 of 1

ghost hostname

Posted: Tue Aug 29, 2023 9:35 pm
by rockyd
Weird issue I noticed recently. I connected a Brother printer to my network and it was allocated an IP address via DHCP (in this case it was 172.16.0.21 and the Brother hostname was listed under connected hosts), I later changed the IP address via assign static IP address under DHCP. I rebooted things, and the printer took on the new IP address. A few days later I connected something else via DHCP, and it was allocated 172.16.0.21. Under connected hosts there were 2 Brother hostnames listed, one was the real one, and one was a ghost one listed for the device that had the 172.16.0.21 IP address.
I assume there is some sort of hostname cache on the router that may need clearing in such cases, is that correct?

Re: ghost hostname

Posted: Thu Aug 31, 2023 1:29 am
by Lantis
It comes from several places
/tmp/dhcp.leases
/tmp/dhcpv4configleases.gargoyle

Is the ghost entry in one of those?

Re: ghost hostname

Posted: Thu Aug 31, 2023 5:13 am
by rockyd
It may have cleared out by now
It wasn't in
/tmp/dhcp.leases

and I couldn't find
/tmp/dhcpv4configleases.gargoyle

I'll have to try and get 172.16.0.21 allocated again to to see if it come up with the hostname Brother.

Ok I set a VM IP to 172.16.0.21 and sure enough, in the connected hosts screen, hosts with active connections section it shows the host name as Brother.

Re: ghost hostname

Posted: Thu Aug 31, 2023 9:11 am
by Lantis
So was it in either of those files when you got it to appear again?
And, what version are you running.

Re: ghost hostname

Posted: Fri Sep 01, 2023 5:37 am
by rockyd
Lantis wrote:
Thu Aug 31, 2023 9:11 am
So was it in either of those files when you got it to appear again?
No, which made sense since I had set the IP as a static IP on the VM, so I wouldn't expect them to appear in DHCP files.
I had a look in other files also, looking for 172.16.0.21 or Brother, but none of the files I tried looking in had the ip or hostname in them.
Lantis wrote:
Thu Aug 31, 2023 9:11 am
And, what version are you running.
1.12.0

Re: ghost hostname

Posted: Sat Sep 02, 2023 6:48 am
by Lantis
I can’t really recall how it works on 1.12, but I suspect a stale ARP cache
cat /proc/net/arp

Re: ghost hostname

Posted: Sun Sep 03, 2023 10:50 pm
by rockyd
I tried "cat /proc/net/arp", it listed the 172.16.0.21 ip address but the mac address was different to the one for the brother printer. So I am guessing that's not the cause.
I found a hosts.sh file in the WWW folder, thinking that's the script that generates the connected host page, and had look to see if it would give me a clue about what file might contain the ip and hostname. I could see the section that dispays the active connection, but couldn't work out where it got its info from.

Re: ghost hostname

Posted: Mon Sep 04, 2023 12:30 am
by Lantis
/var/lib/gargoyle/define_host_vars.sh
There's also a section that comes out of the gargoyle_header_footer app.

Re: ghost hostname

Posted: Tue Sep 05, 2023 11:45 pm
by rockyd
I have had a play with nslookup both on Gargoyle and on a pc, and it seems that Gargoyle is definitely storing the two IP's with brother as the hostname. But no idea where.
I am wondering is there a way to do the equivalent of
ipconfig /flushdns on Gargoyle?

Re: ghost hostname

Posted: Wed Sep 06, 2023 12:23 am
by rockyd
Found it.
It was in /etc/hosts, don't know how it got in there.
Anyway I made a copy of original, then deleted the line listing 172.16.0.21 Brother
Now Nslookup only shows the one IP address for Brother.