Arbitrary associating an ip to a particular domain
Peter Dambier
peter at peter-dambier.de
Tue May 30 16:36:05 UTC 2006
sebastien.martini at gmail.com wrote:
> Hi guys,
>
> I'm a newbie with bind and i look for any kind of help.
>
> I have a simple bind server caching dns queries, the requests are
> forwarded to my isp if there are not already in cache. This is just a
> basic configuration. So i have a local network, wich use this cache as
> nameserver, thus let me explain my problem:
>
> For some reasons i don't want cache and return the real ip of a
> particular domain. For example, if user queries www.foo.com (which
> doesn't belong to me), i don't want that bind first forward the query
> to my isp then reply with the appropriate ip, instead, i wish it had
> replied say with 192.168.0.1 (a local server). In short, i want to
> associate www.foo.com with a fixed ip: 192.168.0.1 and that without
> forwarding the request.
>
> First i don't know the best way to resolve my problem: is it possible ?
> should i insert the couple of values in the cache ? can i ? is there
> some tools doing that ?
>
> BTW, i don't want to modify the clients hosts files.
>
> Thanks in advance for your help,
>
> sébastien
>
Allo Sébastien,
in named.conf you must load a zonefile for foo.com
/etc/named.conf:
...
zone "foo.com" in {
type master;
file "foo.com.zone";
allow-query { homenet; };
};
...
homenet is a description of my local clients so I dont accidently
publish this information to the outside.
Next you need a zonefile for foo.com
foo.com.zone:
$TTL 2D
$ORIGIN foo.com.
@ 86400 IN SOA echnaton.serveftp.com. peter.peter-dambier.de. 20050327 10800 7200 3600000 10800
IN NS MyServer
MyServer IN A 127.0.0.1
@ IN A 127.0.0.1
* IN A 127.0.0.1
www IN A 192.168.0.1
Et voilà, il n'y a plus de popup de l'estie de foo.com
But in case you need them, you might add the MX records of the real
foo.com so you can still email them
Salue
Peter et Karin Dambier
--
Peter and Karin Dambier
Cesidian Root - Radice Cesidiana
Graeffstrasse 14
D-64646 Heppenheim
+49(6252)671-788 (Telekom)
+49(179)108-3978 (O2 Genion)
+49(6252)750-308 (VoIP: sipgate.de)
mail: peter at peter-dambier.de
mail: peter at echnaton.serveftp.com
http://iason.site.voila.fr/
https://sourceforge.net/projects/iason/
More information about the bind-users
mailing list