Page 1 of 1

Using hostname.local instead of IP address.

Posted: Thu Feb 23, 2023 12:57 am
by michael9000

Using F96-CE, kernel 6.1.9.

Is it possible to SSH into another linux system using user@hostname.local instead of user@192.168.x.x?

For example: ssh derek@dereksPC.local

I'm also trying to automount a samba share using an entry in fstab but this will not work using user@hostname.local. It does work with user@192.168.x.x.

On other linux distros this has been handled by the avahi daemon. I installed avahi using ppm but after reboot the avahi daemon seems to be not running. I can't find it using htop anyway. I tried starting it with systemctl but that wasn't recognised.


Re: Using hostname.local instead of IP address.

Posted: Thu Feb 23, 2023 2:04 am
by Sofiya
michael9000 wrote: Thu Feb 23, 2023 12:57 am

Using F96-CE, kernel 6.1.9.

Is it possible to SSH into another linux system using user@hostname.local instead of user@192.168.x.x?

For example: ssh derek@dereksPC.local

I'm also trying to automount a samba share using an entry in fstab but this will not work using user@hostname.local. It does work with user@192.168.x.x.

On other linux distros this has been handled by the avahi daemon. I installed avahi using ppm but after reboot the avahi daemon seems to be not running. I can't find it using htop anyway. I tried starting it with systemctl but that wasn't recognised.

Using Avahi - https://wiki.archlinux.org/title/Avahi


Re: Using hostname.local instead of IP address.

Posted: Thu Feb 23, 2023 4:00 am
by michael9000

Thanks for your reply.

I looked at the Arch page you linked.

It says install nss-mdns package . I could not find this package in either package manager. Only libnss-mdns_0.14.1.

Maybe I could install nss-mdns from another source but I don't know how to do this.

--Edit--
Installed libnss-mdns_0.14.1.

Arch wiki says next step is run:
stystemctl start avahi-daemon-service

Tried this. Returns:
command not found


Re: Using hostname.local instead of IP address.

Posted: Thu Feb 23, 2023 5:52 am
by Sofiya
michael9000 wrote: Thu Feb 23, 2023 12:57 am

Using F96-CE, kernel 6.1.9.

I tried starting it with systemctl but that wasn't recognised.

try running it like this : /etc/init.d/avahi-daemon start


Re: Using hostname.local instead of IP address.

Posted: Thu Feb 23, 2023 9:26 am
by michael9000

I tried:

/etc/init.d/avahi-daemon start

and got message:

Could not receive return value from daemon process.

The arch wiki page mentions file /etc/nsswitch.conf. I'm unclear what, if anything, I should write into this file.


Re: Using hostname.local instead of IP address.

Posted: Thu Feb 23, 2023 10:24 am
by Sofiya
michael9000 wrote: Thu Feb 23, 2023 9:26 am

I tried:

The arch wiki page mentions file /etc/nsswitch.conf. I'm unclear what, if anything, I should write into this file.

nsswitch.conf

Code: Select all

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns
networks:   files dns
passwd:     files
group:      files
bootparams: files
ethers:     files
netmasks:   files
protocols:  files
rpc:        files
services:   files
netgroup:   files
automount:  files
aliases:    files
sudoers:    files

Re: Using hostname.local instead of IP address.

Posted: Thu Feb 23, 2023 8:37 pm
by michael9000

I copied the correct entry into nsswitch.conf, rebooted just incase, and ran '/etc/init.d/avahi-daemon start' but got the same response - 'Could not receive return value from daemon process'

The avahi package I installed at the start is 'avahi-daemon-0.7-4ubuntu7_amd64'. Is that the correct package?

--update--
I went back to a vanilla F96-CE and followed the same steps but no luck.