foo => foo.local search path

View: New views
5 Messages — Rating Filter:   Alert me  

foo => foo.local search path

by Bill Moseley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm just learning about Avahi.  Please excuse my ignorance.

I'm moving my local home LAN away from centralized DNS for my local
machines.  That is, before I had static (public) IPs and ran bind9
with both internal and external zones which allowed LAN lookups to
find local machines in my domain as well as public IP machines in my
domain.  I also rand dhcpd and used it to centrally manage IPs
assinged to machines (static IPs assiged based on MACs).

My new LAN is much more simple -- with an inexpensive cable router
that handles dhcpd for the local machines and no centralized dns
database for local machines.
I don't really care which IP a machine gets assigned as long as I can
lookup the machine by name.

This seems to be working fine so far.  I can plug in a new machine
named "foo" and then on any other machine in the LAN I can "ssh
foo.local" and it will connect.

Here's where I'm confused, though.

What I'd like is to be able to say "ssh foo" and have the resolver
first search /etc/hosts ("files" in nsswitch.conf), then search for
"foo.local", and then if that fails search for "foo.hank.org" via a
normal dns lookup.

I tried to add "local" to my search in /etc/resolv.conf, but no luck.

For example, I'm on "bumby2" running Ubuntu 9.04 and "toby" is a MacBook.

$ ping toby
ping: unknown host toby

$ ping toby.local
PING toby.local (192.168.1.13) 56(84) bytes of data.
64 bytes from toby.local (192.168.1.13): icmp_seq=1 ttl=64 time=20.6 ms

$ cat /etc/resolv.conf
# Generated by NetworkManager
domain local
search local
nameserver 192.168.1.1


$ host -v toby
Trying "toby.local"
Trying "toby"
Host toby not found: 3(NXDOMAIN)
Received 97 bytes from 192.168.1.1#53 in 16 ms

Is there a way to have the resolver try "toby.local" when I specify "toby"?




--
Bill Moseley
moseley@...
_______________________________________________
avahi mailing list
avahi@...
http://lists.freedesktop.org/mailman/listinfo/avahi

Re: foo => foo.local search path

by Félix Arreola Rodríguez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, I have the same problem too.

Thanks
---
Atte. Félix Arreola Rodríguez,
Firmado con GPG, llave 223D869A


_______________________________________________
avahi mailing list
avahi@...
http://lists.freedesktop.org/mailman/listinfo/avahi

signature.asc (204 bytes) Download Attachment

Re: foo => foo.local search path

by Lennart Poettering-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 28.06.09 09:23, Bill Moseley (moseley@...) wrote:

> What I'd like is to be able to say "ssh foo" and have the resolver
> first search /etc/hosts ("files" in nsswitch.conf), then search for
> "foo.local", and then if that fails search for "foo.hank.org" via a
> normal dns lookup.

We used to support that. But I removed it because that cannot work
properly. The simple reason is that would make every name a potential
mDNS name which would then mean that we'd have to resolve every
hostname via mDNS first, which is not really useful however, since
resolving host names that don't exist with mDNS will result in long
timeout. Which hence means, resolving *any* name will take 2s or so.

I guess you need to accept that typing .local as suffix for all local
hostnames is the only viable option.

Lennart

--
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4
_______________________________________________
avahi mailing list
avahi@...
http://lists.freedesktop.org/mailman/listinfo/avahi

Re: foo => foo.local search path

by Bill Moseley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Jun 29, 2009 at 2:24 PM, Lennart
Poettering<lennart@...> wrote:
> We used to support that. But I removed it because that cannot work
> properly. The simple reason is that would make every name a potential
> mDNS name which would then mean that we'd have to resolve every
> hostname via mDNS first, which is not really useful however, since
> resolving host names that don't exist with mDNS will result in long
> timeout. Which hence means, resolving *any* name will take 2s or so.

Ok.

But, can you explain why mDNS would be first?  Wouldn't the typical
search order be for /etc/hosts, then DNS, and mDNS?
I guess I'm not getting why every DNS would take 2 seconds.  Wouldn't
that only be for failed lookups?


> I guess you need to accept that typing .local as suffix for all local
> hostnames is the only viable option.

Not the end of the world, true.  I should probably rename that machine
I have called "local", though, as typing local.local is a bit odd...





--
Bill Moseley
moseley@...
_______________________________________________
avahi mailing list
avahi@...
http://lists.freedesktop.org/mailman/listinfo/avahi

Re: foo => foo.local search path

by Lennart Poettering-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 29.06.09 17:19, Bill Moseley (moseley@...) wrote:

>
> On Mon, Jun 29, 2009 at 2:24 PM, Lennart
> Poettering<lennart@...> wrote:
> > We used to support that. But I removed it because that cannot work
> > properly. The simple reason is that would make every name a potential
> > mDNS name which would then mean that we'd have to resolve every
> > hostname via mDNS first, which is not really useful however, since
> > resolving host names that don't exist with mDNS will result in long
> > timeout. Which hence means, resolving *any* name will take 2s or so.
>
> Ok.
>
> But, can you explain why mDNS would be first?  Wouldn't the typical
> search order be for /etc/hosts, then DNS, and mDNS?

Sure you could put mDNS last. But then still for *every* non-existing
lookup you'll get a 2s timeout while traditionally you get a quick
NXDOMAIN reply.

Also note that many providers/companies/AP providers do weird things
with unknown domains in their DNS servers, i.e. redirect it to their
search engine, yadda, yadda. So if you put mDNS last mDNS won't be
reachable at all anymore, on those networks.

Also, this way you leak quite a bit of information on your local
network to the internet, since every local lookup would first go to
the internet DNS servers.

Lennart

--
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4
_______________________________________________
avahi mailing list
avahi@...
http://lists.freedesktop.org/mailman/listinfo/avahi