Wildcard in /etc/hosts file

14,330

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:
14,330

Related videos on Youtube

Peter Smit
Author by

Peter Smit

Currently working as Doctoral Student in the Speech Group of the Department of Signal Processing and Acoustics of the Aalto Univerity School of Electrical Engineering (formerly TKK / Helsinki University of Technology) in Helsinki, Finland.

Updated on September 17, 2022

Comments

  • Peter Smit
    Peter Smit almost 2 years

    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?

    • Admin
      Admin over 13 years
      What distro are you using?
    • Admin
      Admin over 13 years
      @Mark Ubuntu 10.10
  • ephemient
    ephemient over 13 years
    Indeed. This is rather trivial with dnsmasq; a configuration with address=/local/127.0.0.1 does what OP requests.