From: vermaden <vermaden@interia.pl>
To: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
Cc: zsh-users@zsh.org
Subject: Re: How to disable completion of 127.0.0.1 entries from /etc/hosts
Date: Mon, 01 Apr 2013 22:48:35 +0200 [thread overview]
Message-ID: <ydjymcwjilbegsauwrnk@dpru> (raw)
In-Reply-To: <20130331103044.GA25277@redoubt.spodhuis.org>
> 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
prev parent reply other threads:[~2013-04-01 20:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-31 8:29 vermaden
2013-03-31 10:30 ` Phil Pennock
2013-03-31 21:07 ` Bart Schaefer
2013-04-01 20:48 ` vermaden [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ydjymcwjilbegsauwrnk@dpru \
--to=vermaden@interia.pl \
--cc=zsh-users@zsh.org \
--cc=zsh-workers+phil.pennock@spodhuis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).