6

I would like to set one IP for a zone (livejournal.com)

currently I am having to directly type the subdomains like:

11.11.11.11 sub1.livejournal.com
11.11.11.11 sub2.livejournal.com
11.11.11.11 sub3.livejournal.com

etc.

I tried

11.11.11.11 *.livejournal.com

and

11.11.11.11 .livejournal.com

didn't help.

So I want to have only one line and resolve missing subdomains to IP like: sub1000.livejournal.com without explicitly specifying it

  • The word you are looking for is domain. – Steve-o Aug 25 '11 at 8:58
  • ok, that's not possible. Got it. – bakytn Aug 25 '11 at 9:04
4

This can be implemented with a DNS forwarder than acts like a very basic DNS server. The popular implementation is Dnsmaq, however this might be possible with services like OpenDNS that can perform DNS filtering for you.

|improve this answer|||||
8

No, it is not possible to use wildcards in /etc/hosts.

It is, however, possible to list multiple hosts on a single line so you don't have to keep copying the IP part, just append new hosts to the line:

11.11.11 sub1.livejournal.com sub2.livejournal.com sub3.livejournal.com
|improve this answer|||||
5

Not possible. Each entry in /etc/hosts maps an address to one or more specific hostnames. There is no way to do a wildcard mapping as you desire; use a DNS server instead.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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