DNS redirects with Bind9

0

My Domain of the network is hlg.cu, what I want to do is that the main DNS 192.168.16.1, by making some request to any other page or site that does not belong to the network that redirects me to the Home page which is 192.168.16.102, so I have the DNS configured, that redirection that makes it both in https with http, I have tried several methods but it does not work, so I have configured the dns:

$ ORIGIN. $ TTL 604800; 1 week hlg.cu IN SOA hlg.cu. root.hlg.cu. (             201610557             604800             86400             2419200             604800)             NS ns.hlg.cu.             A 192.168.16.1

$ ORIGIN _tcp.dc._msdcs.hlg.cu. $ ORIGIN hlg.cu. _ntp_udp SRV 0 0 123 ns $ ORIGIN _tcp.hlg.cu.

$ ORIGIN hlg.cu. chat A 192.168.16.111 jabber A 192.168.16.108 news A 192.168.16.114 ns A 192.168.16.1 social A 192.168.16.110 softwra A 192.168.16.114 teamspeak A 192.168.16.108 sales A 192.168.16.105 wow A 192.168.16.250 www A 192.168.16.102 xchat A 192.168.16.111 xnova A 192.168.16.109 travian A 192.168.16.109 revolution A 192.168.16.109 selfie A 192.168.16.112 forum A 192.168.16.113 games A 192.168.16.105 mop A 192.168.16.248

    
asked by Pedro Rafael Santiesteban 01.10.2017 в 19:18
source

1 answer

1

They do not work because the DNS does not redirect, its function is just to return some IP for a name or vice versa (besides other answers like texts, etc), this is done by the DNS protocol port 53. All this before your computer continue with the process of the request, be it HTTP, HTTPS or any other protocol.

Therefore, the DNS does not make decisions based on whether the response is an internal or external IP, it simply returns what it has in its cache or if it does not have the query to the authoritative.

What you could do is somehow trick your DNS into doing a fake root and add type A records to local IPs with a wildcard.

The answer taken from here: enter the description of the link here

In the named.conf set this false root zone: zone "." { type master; file "/etc/bind/db.fakeroot"; };

Then create the fake zone and add the type A records to your destination IP.

@ IN SOA ns.domain.com. hostmaster.domain.com. ( 1 3h 1h 1w 1d ) IN NS <ip> * IN A <ip>

    
answered by 04.10.2017 / 01:45
source