On multiboot linux box with 3 distros (all debian based). All works fine on 2 distros, but 1 is faulty. General things: OpenWrt using DHCP but with static leases, so each OS gets a unique and static IP on boot. The working OSes respond properly with ping and ssh using the host info from the router (OpenWrt). The faulty OS seems to be hanging unto old info from the previous router&setup:
ubun ~ # ping debian
PING debian.oldsubdomain.net (69.172.201.153) 56(84) bytes of data
Where debian.oldsubdomain.net is obsolete, and the real IP is not found though it exists in the router's host name and static lease sections.
I've tried purging software that might be doing this, like dnsmasq, bind etc. The local /etc hosts file has no reference. Yet this persists despite a machine reboot. Internet does work OK on this OS and it does show the proper static lease IP. Some other info:
It looks like your system is getting an IP from the OpenWrt router without any problems. Check your linux host for hostname/IP assignments -- I suspect it is a local issue within that specific host.
Clearly, this is an issue on the local OS, but I've already checked /etc/hosts, .ssh/config, /etc/network/interfaces, Network Manager, as well as all the GUI avenues I can think of. How else can this old domain name be holding on? Even pinging openwrt has it:
Have you tried doing that same ping from other devices on your local network (phone, another computer, etc.)? And have you tried it from the router itself?
@Pippo cleaned arp tables using both arpip cmds, no joy even after reboot. @psherman yes, other distros on same tower, the router and even a wifi laptop with the same version of Ubuntu install...all ping and ssh as expected. I hate to reinstall the OS, but I'm really lost as to why this is happening. Usually, it's something simple I'm just overlooking...
On faulty OS, doing $ ping 192.168.1.1 does correctly ping the router and using the numerical IP address does correctly ping other LAN devices. So I'm thinking it must be some sort of dns thing...but I've hit all the obvious ones I can think of.
Do a grep for the old domain name in your /etc at first and then expand the perimeter to other folders. Maybe it is in a file that you didn't think of.
Often the hostname resides in 2 places: /etc/hostname and /etc/hosts. You might also have it in the dnsmasq.conf file. And if you setup mdns on that system, it might be living somewhere else (like avahi or similar) and might be getting picked up by some other part of the system when you attempt to ping it.
OK, tried good suggestions from @trendy and @psherman ...ie avahi No joy...going to drop this for a while...tired of beating my head against it. I have 2 good working distros on the tower and others on laptops. Later, I'll do some research on ubuntu forums...since openwrt is NOT the problem. Thx for your help...If I find the problem (w/o re-installing ubuntu) I'll post it here.
A bit more research. The prog "network-manager" presents a gui interface in ubuntu > preferences/administration. The file created is /etc/NetworkManager/Wired connection 1. In that file is a line for [IPv4] dns-search=olddomain.net. However, that option does not appear in the gui interface (that I can see). I think it used to, but is not in the latest distro update. In any case, I used a heavy handed method to remove it and will probably have to re-install & reconfigure ubuntu.
So, I restored ubuntu from a recent image (fully configured...thx fsarchiver). Of course the bad line
was still there. The easy way to get rid of it is to stop wired connections, create a new wired connection and use that to restart the connection. Now ubuntu pings the router and the rest of the LAN as it should. Network Manager's connection files live in: /etc/NetworkManager/system-connections. Once the new profile is built, one can delete the defective one. Hope this helps someone else.
Have you actually tried that? Not saying it wouldn't work, but a manual edit of the file certainly doesn't. In any case, someone looking here could try, if the change persists...good to go. If not, making a new wired connection is not too hard either.
It certainly would after reconnect.
You'd better study NetworkManager documentation.
NetworkManager reads connection data only on service startup and operates connection parameters in memory afterwards.
Manual edit can break permissions resulting in connection activation failure or produce backup file leading to collision.