Warum verwenden DNS-Setup-Handbücher private IP-Adressen in ihren Beispielen?

1649
Julian H. Lam

Ich versuche, BIND9 auf meinem Server einzurichten, und versuche, einer Online-Anleitung zu folgen. Eine Sache, die ein Warnflag für mich auslöst, ist, dass jeder Leitfaden, den ich gefunden habe, in seinen Beispielen private IP-Adressen zu verwenden scheint. Immer, wenn ich einen DNS-Dienst eines Drittanbieters wie CloudFlare verwende, gebe ich statt einer Typadresse immer öffentliche IP-Adressen ein 192.168.*.

Ich verstehe, dass dies darauf zurückzuführen ist, dass DNS-Dienste von Drittanbietern (natürlich) nicht über eine private IP-Adresse auf meinen Webserver zugreifen können. Daher ist eine öffentliche IP-Adresse der einzige Weg, um meinen Server zu erreichen. Dies scheint jedoch ein wenig zu sein ungerade, wenn ein DNS-Server eine private IP-Adresse an eine Abfrage zurücksendet. Würde der Benutzer nicht versuchen, eine Verbindung zu dieser privaten IP in seinem eigenen Netzwerk herzustellen?

tl; dr? Zusamenfassend:

Richten Sie BIND9 ein, führt online private IP-Adressen. Wird diese digAusgabe behoben?

julian@server:~$ dig @123.456.789.101 www.example.org  ; <<>> DiG 9.8.1-P1 <<>> @123.456.789.101 www.example.org ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58151 ;; flags: qr aa rd; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2 ;; WARNING: recursion requested but not available  ;; QUESTION SECTION: ;www.example.org. IN A  ;; ANSWER SECTION: www.example.org. 10800 IN CNAME example.org. example.org. 10800 IN A 192.168.182.55  ;; AUTHORITY SECTION: example.org. 10800 IN NS ns1.example.org. example.org. 10800 IN NS ns2.example.org.  ;; ADDITIONAL SECTION: ns1.example.org. 10800 IN A 192.168.182.55 ns2.example.org. 10800 IN A 192.168.182.55  ;; Query time: 2 msec ;; SERVER: 123.456.789.101#53(123.456.789.101) ;; WHEN: Sat Mar 16 18:07:02 2013 ;; MSG SIZE rcvd: 135 
1

1 Antwort auf die Frage

2
LawrenceC

The files you give BIND tell BIND what to return for queries (authoritative), or where go to resolve them (non-authoritative). It will return any address you give it.

Yes, you can have a BIND running on your local network resolving names for your LAN that consist of private IPs. This BIND does not have to be accessible to the Internet at large for that function to work.

Yes, if the instance of BIND is accessible via your NAT router it will return those IPs if the server is queried. A BIND meant for private use only that is publicly accessible can leak details of your network.

Book examples typically use private IP ranges to prevent people blindly copying examples and causing undue traffic to innocent third parties - also, running a DNS server on a LAN that's using IP ranges in a private range is also not uncommon.

The DNS server on your home network won't be accessible by anyone unless:

  • Your static, public IP is registered with a global root zone DNS server, which identifies that public IP as an authoritative zone for a given domain. Specifying a private IP could not be used here.

  • You convince someone to use your publicly accessible DNS server (which will be problematic but not impossible if your ISP gives you a dynamic IP). For this to resolve IPs for any domain other than your own you would have to set up your BIND to use a global DNS as a forwarder (basically forwarding all locally unresolvable DNS lookups to another server such as OpenDNS). They would also get your private IPs which would not work on their local network unless by coincidence. This is a silly idea (unless you really want to join two LANs via a VPN or something esoteric) and generally not what you want to do.

The file above will work but likely not be useful to you unless you really want to be able for programs to lookup via DNS ns1.example.org and get the IP address 192.168.182.55 and so forth.

Ich wollte mit etwas "klugem" antworten, aber dann las ich diese nette Antwort. Weiter so! Ярослав Рахматуллин vor 11 Jahren 0