これがローカル PC (テストおよび開発) 用である場合は、ホスト ファイルを Windows で、またはホストを Linux で編集する必要があります。
ローカル ネットワーク (ubuntu サーバー) 用の仮想 DNS サーバーを作成することで、私が抱えていた問題をローカルで解決しました。
install bind
apt-get install bind9 -y
cd /etc/bind
vim named.conf.options
And uncomment forwarders and two rows bellow and instead of 0.0.0.0 enter google's dns IP (8.8.8.8).
service bind9 restart
vim named.conf.options
zone "YOURDOMAIN NAME" {
type master;
file "db.site.com";
notify yes;
};
cp db.local /var/cache/bind/db.site.com
cd /var/cache/bind/
vim db.sajt1.rs
$TTL 604800
@ IN SOA admin. admin.itlink.edu. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
IN NS ns.YOURDOMAINNAMEHERE.
IN A 192.168.1.10 replace this with the IP of your PC that has apache installed
ns A 192.168.1.10 replace this with the IP of your PC that has apache installed
www A 192.168.1.10 replace this with the IP of your PC that has
service bind9 restart
ubuntuサーバーのIPをDNSとして配置すると、すべてが適切に機能します(解決できないすべてのサイトがGoogle DNSに送信され、解決されるため). ただし、これはローカル ネットワーク専用です。