Take the 2-minute tour ×
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.

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

share|improve this question
    
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
add comment

3 Answers

up vote 3 down vote accepted

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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
share|improve this answer
add comment

Your Answer

 
discard

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.