Перенаправить все DNS-запросы на IP [closed]

У меня есть сервер с операционной системой Ubuntu 12.04 на нем. Я хочу создать DNS-сервер, который принимает все запросы, включая IP-адреса и перенаправить их на указанный IP-адрес ... там пользователи могут входить в систему, а после этого могут просматривать веб-страницы, без ограничений, ТОЛЬКО ПОСЛЕ ВХОДА. Я слышал что-то о Python и Proxy, но я не знаю .....

Спасибо,

1
задан 13 May 2013 в 15:44
1 ответ

I made a captive portal once, and as far as I can remember, i used this document to learn about DNS catchall : http://doc.pfsense.org/index.php/Creating_a_DNS_Black_Hole_for_Captive_Portal_Clients

The main thing you have to do is to give the right DNS IP with your DHCP. Then on your bind DNS, you have to create a catchall zone that always returns the same IP address, whatever the queried domain is :

zone "." {
    type master;
    file "/etc/namedb/db.catchall";
};

Zone :

$TTL    604800
@       IN      SOA     . root.localhost. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL

    IN  NS  .
.   IN  A   192.168.1.5  <--- Your portal IP
*.  IN  A   192.168.1.5  <--- Your portal IP

The "Captive portal" page on Wikipedia explains how this is achieved on Wi-Fi hotspots : https://en.wikipedia.org/wiki/Captive_portal

4
ответ дан 3 December 2019 в 17:50

Теги

Похожие вопросы