ghost hostname

If your problem doesn't fall into one of the other categories, report it here.

Moderator: Moderators

Post Reply
rockyd
Posts: 49
Joined: Tue Oct 22, 2019 5:49 am

ghost hostname

Post 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?

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: ghost hostname

Post by Lantis »

It comes from several places
/tmp/dhcp.leases
/tmp/dhcpv4configleases.gargoyle

Is the ghost entry in one of those?
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

rockyd
Posts: 49
Joined: Tue Oct 22, 2019 5:49 am

Re: ghost hostname

Post 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.

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: ghost hostname

Post by Lantis »

So was it in either of those files when you got it to appear again?
And, what version are you running.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

rockyd
Posts: 49
Joined: Tue Oct 22, 2019 5:49 am

Re: ghost hostname

Post 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

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: ghost hostname

Post by Lantis »

I can’t really recall how it works on 1.12, but I suspect a stale ARP cache
cat /proc/net/arp
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

rockyd
Posts: 49
Joined: Tue Oct 22, 2019 5:49 am

Re: ghost hostname

Post 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.

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: ghost hostname

Post by Lantis »

/var/lib/gargoyle/define_host_vars.sh
There's also a section that comes out of the gargoyle_header_footer app.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

rockyd
Posts: 49
Joined: Tue Oct 22, 2019 5:49 am

Re: ghost hostname

Post 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?

rockyd
Posts: 49
Joined: Tue Oct 22, 2019 5:49 am

Re: ghost hostname

Post 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.

Post Reply