[avahi] No Search list for host-name lookup in resolv.conf
written from avahi-dnsconfd
Lennart Poettering
lennart at poettering.net
Sun Apr 2 06:07:02 PDT 2006
On Sat, 01.04.06 23:59, Claus Klein (claus.klein at arcormail.de) wrote:
> With this modifications, it works for me on Suse linux 9.3:
Seems interesting to me. I would like to merge these changes. However,
I see the following problem. You call dnsdomainname for the search
domain. AFAIK this command does a forward and reverse host name lookup
for the host. Due to this the resulting name data is probably
dependent on the old state of /etc/resolv.conf. This makes a strange
feedback system. Is that really waht you want? Isn't there a big
chance, that dnsdomainname fails completely? (i.e. because the host
name is assigned a single-label name via /etc/hosts)
>
> P3linux:/usr/local/etc/avahi # diff -u avahi-dnsconfd.action.orig avahi-dnsconfd.action
> --- avahi-dnsconfd.action.orig 2006-03-27 22:42:49.000000000 +0200
> +++ avahi-dnsconfd.action 2006-04-01 23:35:31.000000000 +0200
> @@ -46,6 +46,16 @@
> echo "nameserver $n"
> done | /sbin/resolvconf -a "$AVAHI_INTERFACE.avahi"
> fi
> +elif [ -x /sbin/modify_resolvconf ] ; then
> +
> + # We have Suse's modify_resolvconf tool
> +
> + if [ "x$AVAHI_INTERFACE_DNS_SERVERS" = "x" ] ; then
> + /sbin/modify_resolvconf restore -s dnsconfd -p avahi-dnsconfd -t "prepared by ck" -e "$AVAHI_INTERFACE"
> + else
> + /sbin/modify_resolvconf modify -s dnsconfd -p avahi-dnsconfd -t "prepared by ck" -e "$AVAHI_INTERFACE" \
> + -n "$AVAHI_DNS_SERVERS" -l `dnsdomainname`
> + fi
> else
>
> # No resolvconf tool available
> @@ -55,8 +65,9 @@
> else
> test -f /etc/resolv.conf.avahi || mv /etc/resolv.conf /etc/resolv.conf.avahi
>
> + echo search `dnsdomainname` > /etc/resolv.conf
> for n in $AVAHI_DNS_SERVERS ; do
> echo "nameserver $n"
> - done > /etc/resolv.conf
> + done | sort -u >> /etc/resolv.conf
> fi
> fi
Lennart
--
Lennart Poettering; lennart [at] poettering [dot] net
ICQ# 11060553; GPG 0x1A015CC4; http://0pointer.net/lennart/
More information about the avahi
mailing list