When mounting nas hostname don't work but IP is ok

Raspberry Pi related support

When mounting nas hostname don't work but IP is ok

Postby jonas18z » 15 Jan 2015, 19:32

When mounting nas hostname don't work but IP is ok. Anyone know why?

freenas.local is accessible from other computer but not from runeaudio. Don't replay on ping eather on ssh on rasbpi.
Code: Select all
[root@runeaudio ~]# ping freenas.local
ping: unknown host freenas.local

[root@runeaudio ~]# ping 192.168.11
PING 192.168.11 (192.168.0.11) 56(84) bytes of data.
64 bytes from 192.168.0.11: icmp_seq=1 ttl=64 time=0.448 ms
64 bytes from 192.168.0.11: icmp_seq=2 ttl=64 time=0.400 ms


I have 0.3 Beta
User avatar
jonas18z
 
Posts: 34
Joined: 21 Oct 2014, 17:55

Re: When mounting nas hostname don't work but IP is ok

Postby hondagx35 » 15 Jan 2015, 22:53

Hi jonas18z,

*.local querying is not enabled by default in Arch Linux.
You have to install "nss-mdns" and configure it.
See here:
https://wiki.archlinux.org/index.php/av ... resolution
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: When mounting nas hostname don't work but IP is ok

Postby skrodahl » 15 Jan 2015, 23:00

Hi Jonas18z,

I looked into your problem, and I thought it was strange that RuneAudio (which has a mDNS/bonjour service installed, namely avahi-daemon) couldn't lookup other mDNS hosts. The fix is quite simple, and I hope the developers can add it in a later version of RuneAudio:

You need to login to your RuneAudio as root, I can see from your post that you've got that part covered.

Next, run the command 'pacman -Sy' to synchronize the package databases:

Code: Select all
[root@runeaudio ~]# pacman -Sy
:: Synchronizing package databases...
 core        167.2 KiB   341K/s 00:00 [###################] 100%
 alarm      27.2 KiB   223K/s 00:00 [###################] 100%
 aur          67.2 KiB   517K/s 00:00 [###################] 100%


Next, run the command 'pacman -S nss-mdns':

Code: Select all
[root@runeaudio ~]# pacman -S nss-mdns
resolving dependencies...
looking for inter-conflicts...

Packages (1): nss-mdns-0.10-6

Total Download Size:    0.01 MiB
Total Installed Size:   0.07 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages ...
 nss-mdns-0.10-6-armv6h       9.1 KiB  0.00B/s 00:00 [##################] 100%
(1/1) checking keys in keyring       [##################] 100%
(1/1) checking package integrity          [##################] 100%
(1/1) loading package files        [##################] 100%
(1/1) checking for file conflicts       [##################] 100%
(1/1) checking available disk space        [##################] 100%
(1/1) installing nss-mdns          [##################] 100%
==> To enable IPv4 multicast DNS lookups, append 'mdns4' to the hosts line
    in /etc/nsswitch.conf. Use 'mdns6' for IPv6 or 'mdns' for both.


Finally edit the file /etc/nsswitch.conf using nano or vi. It looks like this to begin with:

Code: Select all
[root@runeaudio ~]# cat /etc/nsswitch.conf
# Begin /etc/nsswitch.conf

passwd: files
group: files
shadow: files

publickey: files

hosts: files dns myhostname
networks: files

protocols: files
services: files
ethers: files
rpc: files

netgroup: files

# End /etc/nsswitch.conf


Change the line that starts with the word "hosts" to look like this:

Code: Select all
hosts: files mdns_minimal [NOTFOUND=return] dns myhostname


It's important that the words "mdns_minimal [NOTFOUND=return]" are listed before the word "dns".

Now try pinging your NAS:

Code: Select all
[root@runeaudio ~]# ping freenas.local
PING freenas.local (192.168.0.11) 56(84) bytes of data.
64 bytes from freenas.local (192.168.0.11): icmp_seq=1 ttl=64 time=0.606 ms
64 bytes from freenas.local (192.168.0.11): icmp_seq=2 ttl=64 time=0.404 ms
-skrodahl

Muffsy Phono Preamp PP-3 || Audiobah TPA3116 || ESP P88 || ProJect Debut Carbon Espirit DC || RuneAudio / RaspBerry Pi / HifiBerry DAC || Dynaco A25
User avatar
skrodahl
Moderator
 
Posts: 160
Joined: 27 Jan 2014, 10:08
Location: Sweden

Re: When mounting nas hostname don't work but IP is ok

Postby hondagx35 » 15 Jan 2015, 23:48

Hi skrodahl,

thank you for the detailed how-to.
I will discuss this with the devolopers.

frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: When mounting nas hostname don't work but IP is ok

Postby skrodahl » 16 Jan 2015, 16:13

hondagx35 wrote:Hi skrodahl,

thank you for the detailed how-to.
I will discuss this with the devolopers.

frank


Please note that this only works with the .local domain. That shouldn't be a problem, as it is what's used for RuneAudio and most other devices. If the mDNS domain is something else, the mdns4 module must be used instead of mdns_minimal. I can't get it to work without a sever performance hit on other nslookups though.

If you were to compile nss-mdns with the non-standard --enable-search-domains flag, you could also add "search local" in /etc/resolv.conf, you could even do dns queries withouth using .local at the end. In the example from Jonas, he could do a "ping freenas" instead of "ping freenas.local".
-skrodahl

Muffsy Phono Preamp PP-3 || Audiobah TPA3116 || ESP P88 || ProJect Debut Carbon Espirit DC || RuneAudio / RaspBerry Pi / HifiBerry DAC || Dynaco A25
User avatar
skrodahl
Moderator
 
Posts: 160
Joined: 27 Jan 2014, 10:08
Location: Sweden

Re: When mounting nas hostname don't work but IP is ok

Postby jass199012 » 20 Sep 2017, 16:01

Hi skrodahl,

I know this is an old thread, but I dont want to open a duplicate thread. So posting my question and hope I get a response.

I am facing this very issue on 0.4-beta on my RPi 2.
I am trying to access my windows 7 PC's shared drive using a hostname instead of IP address. I found this thread and followed all your steps, but it did not work. I got the following error:

"socket: Address family not supported by protocol"

ping -4 RMY-PC.local also did not work.

And I did not save any logs. Apologies for that.

Since I am a little comfortable with debian (and totally dumb when it comes to Arch linux), I flashed my card and burned Volumio which did not have this issue. But volumio has ailments of its own. The interface is sluggish and crude. Any changes in audio settings causes a total failure. In short, I am not willing to let go Rune, but this small missing feature is a huge roadblock. Hope you can suggest anything with the partial information that I am able to provide :-)
jass199012
 
Posts: 4
Joined: 20 Sep 2017, 15:44

Re: When mounting nas hostname don't work but IP is ok

Postby hondagx35 » 20 Sep 2017, 16:40

Hi jass199012,

I am trying to access my windows 7 PC's shared drive using a hostname instead of IP address.

Hope you can suggest anything with the partial information that I am able to provide :-)

I did some tests and it works without problems.
- Windows7 PC (FR-MOBIL3)
- shared drive
- latest image from here

I am able to ping the PC with
Code: Select all
root@runeaudio(rw):~# ping -4 FR-MOBIL3
PING FR-MOBIL3.fritz.box (192.168.0.106) 56(84) bytes of data.
64 bytes from fr-mobil3.fritz.box (192.168.0.106): icmp_seq=1 ttl=128 time=0.650 ms
64 bytes from fr-mobil3.fritz.box (192.168.0.106): icmp_seq=2 ttl=128 time=0.652 ms
64 bytes from fr-mobil3.fritz.box (192.168.0.106): icmp_seq=3 ttl=128 time=0.481 ms


I am also able to setup the share with its hostname.
- IP-address = FR-MOBIL3

Please try it without ".local" and report.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: When mounting nas hostname don't work but IP is ok

Postby jass199012 » 20 Sep 2017, 19:08

Hi Frank,

Thanks for the response.
Did you do anything in addition to the steps mentioned by skrodahl? Because I remember trying without .local also, without success. But will be able to confirm after I try again. Unfortunately, I bricked my card trying to burn RuneAudio image once more. I'll purchase another one on my way back from office tomorrow and will try to get back with the results ASAP. Please bear with me.

Thanks
- Jass
jass199012
 
Posts: 4
Joined: 20 Sep 2017, 15:44

Re: When mounting nas hostname don't work but IP is ok

Postby jass199012 » 21 Sep 2017, 15:19

Hi Frank,

I got a new card and did the following, in order:
1. Burned the image (succeeded)
2. Tried to mount RMY-PC from web interface, and ping via ssh (failed)
3. Installed nss-mdns and updated /etc/nsswitch.conf as suggested by skrodahl (succeeded)
5. a. ping RMY-PC (failed; error: "Address family not supported by protocol")
b. ping -4 RMY-PC (failed; error: "ping: RMY-PC: Name or service not known")
c. ping RMY-PC.local (failed; error: "Address family not supported by protocol")
d. ping -4 RMY-PC.local (failed; error: "ping: RMY-PC.local: Name or service not known")
6. ping -4 google.com (succeeded)
7. Tried to mount RMY-PC from web interface (failed)

RMY-PC has two shared drives (one for audio, another for video), accessible through a separate user (with password).
My other pi, running OSMC, is able to read files from both the drives.

Thanks,
-Jass
jass199012
 
Posts: 4
Joined: 20 Sep 2017, 15:44

Re: When mounting nas hostname don't work but IP is ok

Postby jass199012 » 23 Sep 2017, 09:45

Hi,

Finally it worked!
1. Installed nss-mdns
2. Edited the nsswitch.conf. Now the hosts line looks like this:

Code: Select all
hosts: files mdns_minimal dns wins myhostname


All the steps are same as suggested by skrodahl, except for the following two changes in the hosts line:
a. Changed "mdns_minimal [NOTFOUND=return]" to "mdns_minimal"
b. Added "wins" after "dns".

Without "wins" my setup wouldn't resolve windows machines, and "NOTFOUND=return" would cause it to give up if a host is not found in .local domain.

Moving on to next tasks: 1. Adding a power switch circuit, 2. Adding an IR remote, 3. Making the setup readonly to make it power-fail-safe. :)


Thanks,
-Jass
jass199012
 
Posts: 4
Joined: 20 Sep 2017, 15:44

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 9 guests
cron