Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to disable completion of 127.0.0.1 entries from /etc/hosts
- X-seq: zsh-users 17744
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: vermaden <vermaden@xxxxxxxxxx>
- Subject: Re: How to disable completion of 127.0.0.1 entries from /etc/hosts
- Date: Sun, 31 Mar 2013 06:30:44 -0400
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=GYCyqxUt9lJiDxTvyxwugFSl/qX258tom2XKbzkK4gg=; b=NxDmU9S7eNfeXKM40+VipEcg3JsKZEbsf5iRJuKlmXIOt543wdAn1pvQWNgmE49pEE92FMQBM3HyaPnba8g2w5kGyQkDCr8u2rvzSkmSt0GETr/B2AOYaArx91BLzCyTCQ3M+jN8CufT7jhJ0b5tjWVywS6446Xvaluo9LtZkko=;
- In-reply-to: <opaiogkxyconqysbspxp@swqo>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mail-followup-to: vermaden <vermaden@xxxxxxxxxx>, zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <opaiogkxyconqysbspxp@swqo>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author