一部のグローバルウェブサイト(google.com、Facebook.com)をローカルIPアドレス(例:192.168.0.1)で確認する方法。誰でも私を助けることができますか?
; Authoritative data for facebook.com zone
;
$TTL 1D
@ IN SOA epc.facebook.com root.epc.facebook.com. (
2017031301 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
$ORIGIN facebook.com.
epc IN A 127.0.0.1
facebook.com IN A 192.168.0.1
しかし、採掘結果は次のとおりです。
; <<>> DiG 9.10.3-P4-Raspbian <<>> facebook.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21851
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;facebook.com. IN A
;; ANSWER SECTION:
facebook.com. 3441 IN A 185.60.216.35
;; Query time: 1 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Tue Jan 30 16:51:44 UTC 2018
;; MSG SIZE rcvd: 57
構成ファイルの解析
# Generated by resolvconf
nameserver 192.168.0.1
名前:
cat named.conf.default-zones
// prime the server with knowledge of the root servers
zone "." {
type hint;
file "/etc/bind/db.root";
};
// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912
zone "localhost" {
type master;
file "/etc/bind/db.local";
};
zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};
zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};
zone "com.farizHost.arpa" {
type master ;
file "/etc/bind/fariz.zone.db" ;
};
そして..
root@raspberrypi:/etc/bind# cat named.conf.options
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
// forwarders {
// 0.0.0.0;
// };
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
ベストアンサー1
ドメイン名facebook.comを確認するには、次のディレクティブを追加する必要があります。
zone "facebook.com" {
type master;
file "/etc/bind/facebook.db";
};
ここで、facebook.dbは質問の冒頭にあるファイルです。
SOAも修正する必要があります。
IN SOA epc.facebook.com. root.epc.facebook.com. (
ところで、SOAドメインがfacebook.comである必要はありません。