# Resolving local domain names



## silverlokk (Dec 19, 2015)

My laptop boots either Zorin GNU/Linux or GhostBSD 10.1, mostly the latter now that I have most of what I was looking for in the former. Oh, and Windows when I'm in a masochistic mood.

I also have a BeagleBone Black running Debian:

```
Linux arm 4.1.12-ti-r29 #1 SMP PREEMPT Mon Nov 9 22:46:19 UTC 2015 armv7l GNU/Linux
```
From Zorin, I could ssh in using its hostname, i.e., `ssh -Y debian@arm.local`. I managed to do that as well from Ghost, but can't do it from arm.local to Ghost -- i.e., I still have to use the IP address. Both my laptop and the Beagle are assigned static IP addresses, if that makes any difference.

I did a little Googling and thought that Avahi might do it. Followed instructions from some site, including adding *_enable="YES"* lines in /etc/rc.conf:

```
avahi_daemon_enable="YES"
mdnsd_enable="YES"
```
and modifying the hosts line in /etc/nsswitch.conf:

```
hosts: files mdns_minimal [NOTFOUND=return] dns mdns
```
When I reboot, I see lines about not being able to find mdns_minimal or mdns (I think, scroll was too fast). From what I remember, the errors had to do with the network being down. I also tried _mDNSIdentify Eowyn-Ghost.local_ and got this:

```
setsockopt - SO_RECV_ANYIF: Protocol not available
setsockopt - SO_RECV_ANYIF: Protocol not available
setsockopt - SO_RECV_ANYIF: Protocol not available
Eowyn-Ghost.local. AAAA FE80:0000:0000:0000:0216:EAFF:FEC5:29CE
Eowyn-Ghost.local. Addr 192.168.0.134
HINFO Hardware: I386
HINFO Software: FREEBSD
mDNS_PurgeCacheResourceRecord: Lock not held! mDNS_busy (0) mDNS_reentrancy (0)
mDNS_PurgeCacheResourceRecord: Lock not held! mDNS_busy (0) mDNS_reentrancy (0)
mDNS_PurgeCacheResourceRecord: Lock not held! mDNS_busy (0) mDNS_reentrancy (0)
No response after 4 seconds
_services._dns-sd._udp.local. PTR Trying multicast
No response after 4 seconds
_services._dns-sd._udp.local. PTR *** No Answer ***
```
Same result when I try _mDNSIdentify arm.local_

Also, just realized that arm.local thought that I had logged in from eowyn-zorin.localhost, when I had logged in from Ghost.

I thought that something may have been screwy with the arm network setup but the errors from _mDNSIdentify_ belie that.

Ideas, please?


----------



## tobik@ (Dec 19, 2015)

Is dns/nss_mdns installed?


----------



## silverlokk (Dec 19, 2015)

Yes, that was part of the instructions from the Web site I mentioned


----------



## tobik@ (Dec 19, 2015)

You seem to have enabled both mDNSResponder and Avahi. AFAIK you need to choose one. If you use mDNSResponder you need dns/mDNSResponder_nss for name resolution.


----------



## krawall (Dec 21, 2015)

Just a very obvious idea, but you don't sound like you really need a automated solution for a big network (and I always feel that zeroconf is some kind of dark magic). So why don't just put the IP addresses and hostnames in every /etc/hosts?


----------



## silverlokk (Dec 22, 2015)

krawall said:


> Just a very obvious idea, but you don't sound like you really need a automated solution for a big network (and I always feel that zeroconf is some kind of dark magic). So why don't just put the IP addresses and hostnames in every /etc/hosts?


Yeah, was thinking of that too. Using something like zeroconf because I want to build skills that will enable me to move up to a larger network in the future.

Here's the latest: I did manage to ssh into my FreeBSD box from my Beagle using the eowyn-zorin.local address, which is what I use when I'm booted into Zorin GNU/Linux. I think what complicates my setup is my dual-boot into both GNU/Linux and FreeBSD


----------



## SirDice (Dec 22, 2015)

Please note that this isn't quite zeroconf. It's mDNS, which is only (a small) part of zeroconf. If set up properly you can achieve the same using DDNS (by combining BIND and DHCP).


----------



## Deleted member 9563 (Dec 22, 2015)

Building skills is a good idea. However in this case the hosts file really is a better solution I think. I have a lot of computers on my home network, and even more that aren't usually connected. They each have a 3 letter name and that's all I type. It's quick to type, easy to remember, and very low maintenance. For simplicity I put the hosts file in the wan router so everybody gets the same local DNS, and I only maintain one file.


----------



## SirDice (Dec 22, 2015)

For my home network I took some time to configure net/isc-dhcp42-server and dns/bind99 together. The added bonus of this as opposed to mDNS is that it works for everything. For mDNS you need some packages on the client and not all devices support mDNS. The DDNS solution is a bit more involved setting up but works more generally on more devices.


----------



## Oko (Dec 22, 2015)

On my home network I use OpenBSD dhcpd daemon and Unbound which can be abused to serve local zone files. Works well with Android,Kindel even my Samsung TV and Blue-Ray player. Oh yes Android smart phones like it too.


----------

