Why ping .local?

I have just upgraded to 13.1. Previously on my home network I have been able to ping machines with just their host names. Now, for the 13.1 machines, I have to append .local to the host name. For instance ‘ping tower.local’ instead of "ping local’. Can anyone tell why this is?

Any and all help appreciated.

Please show

grep -v '^#' /etc/resolv.conf
 grep -v '^#' /etc/resolv.conf
search homenet
nameserver 192.168.1.1 

I don’t have a complete understanding of this by any means, but there was a post here concerning hostname resolution and Avahi, describing the same need to append ‘.local’ to the hostname. However, this concerns mDNS/DNS-SD, rather than other kinds of name resolution services. Maybe that makes a difference?

Check out

man nsswitch.conf

Well, from your story I assume that the systems in your LAN have “local” as their domain.
The output above says that when you do only specify a host name (without domain specification), the resolver will try to find if this name exists in the “homenet” domain.

I have no idea why the domain “homenet” is there, but when you change that to

search local

it will try to resolve monkey.local if you ask it to resolve monkey (and the same for others like tower).

But again, I have no idea why “homenet” is there. Thus it could be that resolving systems belonging to the domain “homenet” will be problematic now. When you think the “homenet” is also a valid and often used domain name in your environment, you could go for

search  local  homenet

or

search  homenet local

homenet is there because that is what I put into the Domain Name in YAST’s Network Settings, replacing “site” as the Domain Name.

Then why do you try to use “local”?

My edited nswitch.conf file worked with 12.1, 12.2 and a couple of other opensuse versions. In fact, my nsswitch.conf for 12.1, 12.2 and 13.1 are identical.

I’m trying to figure out what changed from 12.2 to 13.1 and why.

There should have been an edit above. I should have said:
For instance ‘ping tower.local’ instead of "ping tower’.

Bad typing on my part. I should have said:
Now, for the 13.1 machines, I have to append .local to the host name. For instance ‘ping tower.local’ instead of "ping tower’.
Sorry for the confusion.

On Thu 27 Feb 2014 07:16:01 PM CST, rick71 wrote:

deano_ferrari;2627478 Wrote:
> I don’t have a complete understanding of this by any means, but there
> was a post ‘here’ (http://tinyurl.com/kdu3z8g) concerning hostname
> resolution and Avahi, describing the same need to append ‘.local’ to
> the hostname. However, this concerns mDNS/DNS-SD, rather than other
> kinds of name resolution services. Maybe that makes a difference?
>
> Check out
> >
Code:

> > man nsswitch.conf

> >

My edited nswitch.conf file worked with 12.1, 12.2 and a couple of other
opensuse versions. In fact, my nsswitch.conf for 12.1, 12.2 and 13.1 are
identical.

I’m trying to figure out what changed from 12.2 to 13.1 and why.

Hi
I wonder if it’s related to some DNS hardening. As in homenet is a used
domain name (maybe site gets excluded).

What gets resolved from;


nslookup homenet

I would go grab a free sub domain name and use that… I use
dyndns.org, but go to homenet.org :wink:


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.10-7-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!


rick@tower:~> nslookup homenet
Server:        192.168.1.1
Address:    192.168.1.1#53

** server can't find homenet: NXDOMAIN

I do not know what DNS hardening is. However, I have used my current system for years, and it has just broken under opensuse 13.1. Things worked fine under 12.01. It seems like when they changed the naming scheme for the ethernet interfaces, other things changed. too.

I have a domain. I use dnsexit, instead of dyndns.org, for external access to my testing web server and occasional ftp and ssh. homenet has always worked for an internal domain.

On Thu 27 Feb 2014 08:16:01 PM CST, rick71 wrote:

malcolmlewis;2627512 Wrote:
> Hi
> I wonder if it’s related to some DNS hardening. As in homenet is a
> used domain name (maybe site gets excluded).
>
> What gets resolved from;
> >
Code:

> >
> nslookup homenet
>

> >
> I would go grab a free sub domain name and use that… I use
> dyndns.org, but go to homenet.org :wink:
>
> –
> Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
> openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.10-7-desktop
> If you find this post helpful and are logged into the web interface,
> please show your appreciation and click on the star below… Thanks!

Code:

rick@tower:~> nslookup homenet
Server: 192.168.1.1
Address: 192.168.1.1#53

** server can’t find homenet: NXDOMAIN


I do not know what DNS hardening is. However, I have used my current
system for years, and it has just broken under opensuse 13.1. Things
worked fine under 12.01. It seems like when they changed the naming
scheme for the ethernet interfaces, other things changed. too.

I have a domain. I use dnsexit, instead of dyndns.org, for external
access to my testing web server and occasional ftp and ssh. homenet has
always worked for an internal domain.

Hi
As in being a bit more secure in the way DNS does things, so your
looking at the dns cache on your router, not an external dns. Restart
your router and see what happens.


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.10-7-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

I did already take into account that you made a typo there. Of course you wanted to say “ping tower”. *)

And my answer is based on the fact that when you say

ping tower

and resolv.conf has

search homenet

that means that the resolver start searching for tower.homenet. And most probably that can not be solved. It will NOT search for tower.local with the configuration you showed. Why should it? It can not “guess” that you mean tower.local or tower.something, or tower.whatever. This is no magic, this is computer facts. It can only use what is in configurations. And the confgiguration says to use .homenet when no domain is available.

*)
This why we (I at least) allways ask to copy/paste what you do (prompt, command, output, next prompt) into a post here. That avoids stupid things like typos. This is the age of the computer, not the age of typing what you think that you did yesterday, like the mediaeval monks that copied things by writing. >:)

BTW, what did you do with my advice to experiment with the search statement in /etc/resolv.conf?

I’m not sure what you mean by “experiment with the search statement in /etc/resolv.conf”

Here’s some info all in one place:


### /etc/resolv.conf file autogenerated by netconfig!
search homenet
nameserver 192.168.1.1

rick@tower:~> nslookup homenet
Server:        192.168.1.1
Address:    192.168.1.1#53

rick@tower:~> ping tower
ping: unknown host tower
rick@tower:~> ping tower.homenet
ping: unknown host tower.homenet
rick@tower:~> ping tower.local
PING tower.local (192.168.1.2) 56(84) bytes of data.
64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.039 ms

/etc/HOSTNAME
tower.homenet


I can’t figure out why I have to append .local to the hostname, or where .local is coming from. This was not a problem in my 12.2 install.

I apologize if I am missing something obvious, and I appreciate your help.

On 02/27/2014 04:56 PM, rick71 pecked at the keyboard and wrote:
> hcvv;2627524 Wrote:
>> I did already take into account that you made a typo there. Of course
>> you wanted to say “ping tower”. *)
>>
>> And my answer is based on the fact that when you say
> Code:
> --------------------
> > > ping tower
> --------------------
>> and resolv.conf has
> Code:
> --------------------
> > > search homenet
> --------------------
>> that means that the resolver start searching for tower.homenet. And
>> most probably that can not be solved. It will NOT search for
>> tower.local with the configuration you showed. Why should it? It can
>> not “guess” that you mean tower.local or tower.something, or
>> tower.whatever. This is no magic, this is computer facts. It can only
>> use what is in configurations. And the confgiguration says to use
>> .homenet when no domain is available.
>>
>>
>> *)
>> This why we (I at least) allways ask to copy/paste what you do
>> (prompt, command, output, next prompt) into a post here. That avoids
>> stupid things like typos. This is the age of the computer, not the age
>> of typing what you think that you did yesterday, like the mediaeval
>> monks that copied things by writing. >:)
>>
>>
>> BTW, what did you do with my advice to experiment with the search
>> statement in /etc/resolv.conf?
> I’m not sure what you mean by “experiment with the search statement in
> /etc/resolv.conf”
>
> Here’s some info all in one place:
>
>
> Code:
> --------------------
>
> ### /etc/resolv.conf file autogenerated by netconfig!
> search homenet
> nameserver 192.168.1.1
>
> rick@tower:~> nslookup homenet
> Server: 192.168.1.1
> Address: 192.168.1.1#53
>
> rick@tower:~> ping tower
> ping: unknown host tower
> rick@tower:~> ping tower.homenet
> ping: unknown host tower.homenet
> rick@tower:~> ping tower.local
> PING tower.local (192.168.1.2) 56(84) bytes of data.
> 64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.039 ms
>
> /etc/HOSTNAME
> tower.homenet
>
>
> --------------------
>
>
> I can’t figure out why I have to append .local to the hostname, or where
> .local is coming from. This was not a problem in my 12.2 install.
>
> I apologize if I am missing something obvious, and I appreciate your
> help.
>
>

What do you have in :

code

/etc/hosts

Just to clarify further here, ‘.local’ is a top-level domain reserved for the avahi/zeroconf (mDNS) service. If you have dnsmasq or other DNS-type resolution services running, then alternative domains should be used instead.

I can’t figure out why I have to append .local to the hostname, or where .local is coming from.

I got the gist of that from your opening post.

This was not a problem in my 12.2 install.

I’m curious about that, since the way it is now is the way I understand that it should work, with ‘.local’ being a specialized domain used for avahi and queries handled by the ‘mdns_minimal’ module.

I apologize if I am missing something obvious, and I appreciate your help.

I may well learn some useful information here, so I’m glad you’re digging for the details :slight_smile:

Maybe I can provide some enlightenment…

In general, hostnames are resolved by exact matches.
If you want to resolve by a hostname without its domain, you can create an appropriate shortened hostname entry.

You may be confusing hostname resolution with NetBIOS name resolution (extremely common in pre-Active Directory Windows networks and may still exist with SAMBA3, I haven’t checked but SAMBA3 is based on that technology). NetBIOS name resolution, among other things automatically resolves “shortened” names without the domain.

So, I don’t know how your machines and network were configured before, but if NetBIOS name resolution was configured before, it would explain your observation. Nowadays, almost nobody anywhere uses NetBIOS name resolution although I suppose for those who want to, it’s possible to still run both name resolution systems side by side.

HTH,
TSU

After reading the above I started reading about Avahi ( a little). It seems it doesn’t matter what is listed in the Domain setting in Network Settings in YAST if Avahi/Zeroconf is installed and enabled. Unless Avahi is further configured, .local is used.

I looked and, on my system, dbus-org.freedesktop.Avahi and avahi-daemon are active and enabled, and dnsmasq and Avahi-dnsconfd are disabled and inactive.