LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 03-27-2008, 01:57 PM   #1
NightSoul
LQ Newbie
 
Registered: Nov 2005
Location: Lithuania
Distribution: Slackware 10.2
Posts: 29

Rep: Reputation: 15
Exclamation DNS, Bind, same ip for all requests


Hello,
Is there any way to do that Bind server to all requests respond the same ip adress? For example we ask for www.example.com or www.example2.net and dns server respond that these and all other adresses is 192.168.0.1.

But if Bind can't do this, may be other software can?

Please do not suggest other ways to do that, I need exactly this.


Thanks.
 
Old 03-27-2008, 02:23 PM   #2
tsg
Member
 
Registered: Mar 2008
Posts: 155

Rep: Reputation: 30
An entry in a zone file of
Code:
*        A        192.168.0.1
would do it.
 
Old 03-27-2008, 02:35 PM   #3
NightSoul
LQ Newbie
 
Registered: Nov 2005
Location: Lithuania
Distribution: Slackware 10.2
Posts: 29

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tsg View Post
An entry in a zone file of
Code:
*        A        192.168.0.1
would do it.
Hmm, this work only with one zone ( *.example.com) or with all addresses (*.*)?
 
Old 03-27-2008, 03:06 PM   #4
tsg
Member
 
Registered: Mar 2008
Posts: 155

Rep: Reputation: 30
Quote:
Originally Posted by NightSoul View Post
Hmm, this work only with one zone ( *.example.com) or with all addresses (*.*)?
It would depend on what queries the zone file is set to match.

If your config file lists:

Code:
zone "example.com" in {
           type master;
           file "dummy";
};
and file "dummy" contains that entry, then it will match for all queries to example.com (mail.example.com, host1.example.com, etc), but not any others.

If the config file instead lists:

Code:
zone "." in {
        type master;
        file "dummy";
};
then it will match all queries that don't match another zone (www.example.net, host2.example2.com, etc.)

I actually have this set up to return 127.0.0.1 to all queries to a particular domain I don't want my users (or rather their computers) accessing.
 
Old 03-27-2008, 06:36 PM   #5
NightSoul
LQ Newbie
 
Registered: Nov 2005
Location: Lithuania
Distribution: Slackware 10.2
Posts: 29

Original Poster
Rep: Reputation: 15
Unhappy

Didn't work. Says SERFAIL or NXDOMAIN. If you can, please show full named.conf and zone files examples.

P.S. server's mission - server should respond ONLY one and same IP address to all requests.

Examples:

$dig dummy.dummy.com
dummy.dummy.com. A 127.0.0.1
$dig www.gmail.com
www.gmail.com. A 127.0.0.1
$dig www.linuxquestions.org
www.linuxquestions.org. A 127.0.0.1
...
 
Old 03-28-2008, 08:28 AM   #6
tsg
Member
 
Registered: Mar 2008
Posts: 155

Rep: Reputation: 30
Put this into your named.conf file (or replace it if the zone is there):
Code:
zone "." in {
        type master;
        file "dummy";
};
(if you don't know where this goes, post your existing named.conf file and I'll show you.)

Put this in a file named "dummy" in whatever directory your zone files are configured for (look for a "directory" config in the "options" section of the named.conf file.

Code:
$TTL 86400
@               IN      SOA     ns.yourhost.com. hostmaster.yourhost.com. (
                                2008032701      ; Serial
                                8H      ; Refresh
                                2H      ; Retry
                                1W      ; Expire
                                1D)     ; Minimum
                        NS      ns
*                       A       127.0.0.1
Then restart named (or do "rndc reload").
 
Old 03-28-2008, 11:39 AM   #7
NightSoul
LQ Newbie
 
Registered: Nov 2005
Location: Lithuania
Distribution: Slackware 10.2
Posts: 29

Original Poster
Rep: Reputation: 15
Talking

Quote:
Originally Posted by tsg View Post
Put this into your named.conf file (or replace it if the zone is there):
Code:
zone "." in {
        type master;
        file "dummy";
};
(if you don't know where this goes, post your existing named.conf file and I'll show you.)

Put this in a file named "dummy" in whatever directory your zone files are configured for (look for a "directory" config in the "options" section of the named.conf file.

Code:
$TTL 86400
@               IN      SOA     ns.yourhost.com. hostmaster.yourhost.com. (
                                2008032701      ; Serial
                                8H      ; Refresh
                                2H      ; Retry
                                1W      ; Expire
                                1D)     ; Minimum
                        NS      ns
*                       A       127.0.0.1
Then restart named (or do "rndc reload").

Found on google the same - working. Thanks! :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
stopping dns forwarding requests in BIND shreeram.vk Linux - Server 3 07-10-2008 06:40 AM
Bind will not answer DNS requests jgray1978 *BSD 1 12-25-2007 02:12 PM
Bind isn't forwarding my requests Jim44 Linux - Networking 5 10-28-2007 11:15 AM
DNS requests go to loopback?? curiouspenguin Linux - Networking 5 09-20-2006 03:42 PM
LXer: DNS: The Bind Leading the Bind LXer Syndicated Linux News 0 06-15-2006 10:33 PM


All times are GMT -5. The time now is 07:37 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration