[avahi] Is there a way to set up Avahi to implement “anycast name resolution” on a LAN?
andrew at tj.id.au
Thu Jun 2 19:17:59 PDT 2011
On Fri, Jun 3, 2011 at 11:30 AM, Jeremy Friesner <jaf at meyersound.com> wrote:
> Hi all,
> First, some background: We've got a lab containing a handful of dedicated
> Linux servers that run on an isolated LAN. All the servers run the same OS
> (Debian Linux) and the same proprietary server software, and the server
> processes communicate with each other to keep their data in sync. That means
> that as far as any clients are concerned, it doesn't matter which server the
> client connects to -- any server will return the same data as any other.
> These Linux servers all run avahi-daemon to publish mDNS hostnames for
> themselves, which means that a client can enter e.g.
> "http://linux-server-1.local." into his web browser and connect to Linux
> server #1, and so on.
> This is all well and good, except it means that a user sitting at the client
> machine (typically a Mac or Windows laptop with Bonjour installed) has to
> know (or figure out) which of the Linux servers are currently online, and he
> has to make sure he connects to one of those. For example, if server #2 is
> offline today, and the client enters "http://linux-server-2.local." into his
> URL bar, he's not going to get a response. That isn't the end of the world,
> of course, but it is annoying for newbie users who expect everything to
> "just work", and also it makes the development of robust client-side
> scripting more complicated (since the client-side script would need to know
> how to deal with offline servers explicitly).
> With that in mind, my question is this: is it possible to configure Avahi to
> publish an anycast-style mDNS hostname alias as well? The goal is that
> anyone could sit down with his laptop, enter
> "http://any-linux-server.local." (or similar) into his web browser, and get
> a response from one of the servers that is currently on line (again, it
> doesn't matter which one).
> Note that this needs to work without any special configuration of client
> laptops, as we have no control over them (other than the requirement that
> they have Bonjour installed).
> Also note that we can't rely on the presence of a separate nameserver or
> proxy box, or on the presence of any particular Linux server, since that
> would introduce a single point of failure, which we're trying to avoid.
> avahi mailing list
> avahi at lists.freedesktop.org
The Avahi API could be used to register one or more CNAME records
(there is an example on the wiki) but it seems a little odd to me --
is there a reason you're not using service discovery to find the HTTP
services? It's a checkbox to enable Bonjour in Safari and Bonjour for
Windows includes a plugin for IE. There's also an extension available
for the Windows and OS X versions of Firefox.
More information about the avahi