Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

It seems that wildcards are not supported in the /etc/hosts file.

What is the best solution for me to resolve all *.local domains to localhost?

share|improve this question
What distro are you using? – Mark Davidson Oct 21 '10 at 8:22
@Mark Ubuntu 10.10 – Peter Smit Oct 21 '10 at 11:12
possible cross site duplicate of:… – Ciro Santilli 六四事件 法轮功 包卓轩 Aug 6 '14 at 9:30

1 Answer 1

up vote 12 down vote accepted

You'd really need to run your own DNS server and use wildcards. Exactly how you'd do that would depend on the DNS package you ran.

share|improve this answer
Indeed. This is rather trivial with dnsmasq; a configuration with address=/local/ does what OP requests. – ephemient Oct 21 '10 at 13:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.