You are not logged in.
Hi,
I am trying to SSH to another computer on my network, which I just rebooted, but I can't connect, even though it was working just before.
So, the first thing I think is that I have a problem of DNS caching. And indeed, if I connect using the new IP address, 192.168.1.5, it works. But if I ping the hostname, it redirects to 192.168.1.8.
I try everything on this webpage: https://www.cyberciti.biz/faq/rhel-debi … dns-cache/. But the only related service that I have is nscd, and restarting it doesn't help.
The weirdest part is, if I search the local IPs:
nmap -sL 192.168.1.0/24
I get an answer for both 192.168.1.5 and 192.168.1.8, associated to the hostname.
However, I only have one computer with this hostname. And this computer has only a wired connection (no wifi enabled now).
So, what do I miss?
Thanks!
Last edited by dmidge (2019-05-05 13:15:23)
Offline
Hi there, first thing that springs to mind is the hosts file, check /etc/hosts for the old entry and change it.
Offline
If you're using 'NetworkManager' restart the service. Also check the arp cache.
Last edited by Maniaxx (2019-05-05 14:51:35)
sys2064
Offline
Hi,
Sorry for the delay.
For the host file, it looks like that:
% cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
127.0.0.1 bob-aspire-e15.localdomain bob-aspire-e15
# End of file
This one seems good.
Sadly, rebooting the network manager didn't work so far. Or am I rebooting the right service? I rebooted netctl.
Thanks!
Cheers.
Offline
Well, no, it doesn't seem good. Didn't you notice the double loopback entry?
You should probably be using '192.168.1.5' - your new IP for your hostname entry, like:
192.168.1.5 bob-aspire-e15.localdomain bob-aspire-e15
Offline
Hm, so I gather that having 2 references to localhost is not good then.
But bob-aspire-e15 correspond to the my local computer. So, if this line should not be present, it should not be 192.168.1.5, which is the target where I want to ssh.
My local IP address, associated to bob-aspire-e15, is 192.168.1.10.
Offline
Let's please first clarify how you're actually resolving local domains.
systemctl --user list-unit-files --state=enabled
cat /etc/nsswitch.conf
cat /etc/resolv.conf
nscd is ldap is configured statically on the ldap sever, see https://wiki.archlinux.org/index.php/LDAP_Hosts
So *iffffff* you're running an ldap server and that resolves local domains you'll have to update its list before everything else.
Offline
Hi Seth,
Thank you for your time also!
I don't think I have a ldap server. However, I did have a DHCP update script (to update an outside-of-my-LAN DNS) on one of my computer on the network. I don't think it is functioning now (sadly, I lack of time for that).
% systemctl --user list-unit-files --state=enabled :(
UNIT FILE STATE
xdg-user-dirs-update.service enabled
dirmngr.socket enabled
gpg-agent-browser.socket enabled
gpg-agent-extra.socket enabled
gpg-agent-ssh.socket enabled
gpg-agent.socket enabled
p11-kit-server.socket enabled
pipewire.socket enabled
pulseaudio.socket enabled
9 unit files listed.
% cat /etc/nsswitch.conf
# Name Service Switch configuration file.
# See nsswitch.conf(5) for details.
passwd: files mymachines systemd
group: files mymachines systemd
shadow: files
publickey: files
hosts: files mymachines myhostname resolve [!UNAVAIL=return] dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
netgroup: files
% cat /etc/resolv.conf
# Generated by NetworkManager
search Home
nameserver 192.168.1.1
Last edited by dmidge (2019-06-02 21:39:53)
Offline
Your resolve.conf seems written by NetworkManager and seems to be your router (192.168.1.1) which would usually get hostnames via the dhcp request (if it provides sth. like dnsmasq and is not just forwarding eg. your ISPs DNS)
There's also no mdns or wins involved.
More interestingly, NM isn't even enabled, so what configures your network itfp?
Also check whether the router keeps a list of the local hostnames, try eg.
dig @192.168.1.1 <hostname>
Also ensure your hostnames are not just resolved through /etc/hosts (on every used machine)
Offline