LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   DNS, Bind, same ip for all requests (http://www.linuxquestions.org/questions/linux-networking-3/dns-bind-same-ip-for-all-requests-631085/)

NightSoul 03-27-2008 01:57 PM

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.

tsg 03-27-2008 02:23 PM

An entry in a zone file of
Code:

*        A        192.168.0.1
would do it.

NightSoul 03-27-2008 02:35 PM

Quote:

Originally Posted by tsg (Post 3102273)
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 (*.*)?

tsg 03-27-2008 03:06 PM

Quote:

Originally Posted by NightSoul (Post 3102292)
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.

NightSoul 03-27-2008 06:36 PM

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
...

tsg 03-28-2008 08:28 AM

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").

NightSoul 03-28-2008 11:39 AM

Quote:

Originally Posted by tsg (Post 3103068)
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! :-)


All times are GMT -5. The time now is 06:35 AM.