From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14701 invoked by alias); 1 Apr 2013 20:48:46 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17748 Received: (qmail 19674 invoked from network); 1 Apr 2013 20:48:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at interia.pl designates 217.74.65.207 as permitted sender) Date: Mon, 01 Apr 2013 22:48:35 +0200 From: vermaden Subject: Re: How to disable completion of 127.0.0.1 entries from /etc/hosts To: Phil Pennock Cc: zsh-users@zsh.org X-Mailer: interia.pl/pf09 In-Reply-To: <20130331103044.GA25277@redoubt.spodhuis.org> References: <20130331103044.GA25277@redoubt.spodhuis.org> X-Originating-IP: 77.114.7.23 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interia.pl; s=biztos; t=1364849315; bh=I04qyQKdM1nehRnR3GK1ZdhFCGAulvcuVv04gpdlTQg=; h=Date:From:Subject:To:Cc:X-Mailer:In-Reply-To:References: X-Originating-IP:Message-Id:MIME-Version:Content-Type: Content-Transfer-Encoding; b=SN7RqcJNMEmCzxvn78cmGIlT5LmzDOUN5bPPVLfqgKy05WAwtuUTMoaxrERqyV69p YdKrN/iDK7eB2qtxhj8Utb9Lb9OTT3qtFux1rabcrSUkiqAseJSXFQCF8x6ol1+g5w JYSsM58kFx/4IS09f67eVZL68kXYwTXzqLqMVEhk= > On 2013-03-31 at 10:29 +0200, vermaden wrote: > > Hi all,I use 'static' 127.0.0.1 entries in /etc/hosts to block various > > things, like described here for > > example:http://someonewhocares.org/hosts/ Of course ZSH always tries > > to 'complete' the ssh/scp and always goes thru about 100 000 entries > > in my /etc/hosts file while the 'real' ones are about 100 maybe at > > most. My question is: Is there a way to 'tell' ZSH to NOT complete > > entries beginning with 127.0.0.1 from the /etc/hosts file? > > Regards,vermaden > > Are you aware that the contents of /etc/hosts get loaded into _every_ > process doing hostname resolution? And the file isn't mmap'd in and so > shared, but is instead _read_ into each process, so is not shared > memory? > > Seriously, install unbound, use unbound-control and/or home-grown tools > to maintain the list of overrides, make sure the cost of filtering is > only borne once, instead of having zsh also load a 4MB hosts file and > parse it out. Your system will be faster for _every_ hostname-resolving > package, not just zsh. > > Otherwise, use zstyle to set 'hosts': > > zstyle ':completion:*:hosts' hosts $the_hosts_you_care_about > > and so override the automatic parsing of /etc/hosts. Thank You for Your suggestions and two various solutions, that solves the problem ;) Regards, vermaden