我希望有人能帮我做这个-我想-简单的任务。
情况:
在我的私人局域网上,我运行一个Internet路由器("Fritz!Box")和一个带有Ubuntu20.04LTS的Raspberry Pi。我开发了一个Spring应用程序,用于私有目的,我只想在我的局域网中使用(或者可能通过VPN从外部到达)。Web的本地网址是"http://ubuntu:8080““,因为我的Raspberry叫做" ubuntu”,应用程序运行在Tomcat上。现在,我想在局域网内公开一个类似于"http://thats-my.app“的URL,并将其用作应用程序的基本URL。目前,在ubuntu上的卷曲无法到达,我的另一台PC无法达到。
更好的是FQDN "http://wow.thats-my.app“(带有子域),这样我就可以对所有应用程序使用相同的域和顶级域,并且只改变子域,比如"http://super.thats-my.app”等等。免责声明:由于我通过SSH工作,所有配置都是终端专用的。请考虑我不使用Ubuntu的桌面表面。
提前感谢您的时间,希望您的帮助!
Here是我对ubuntu系统所做的设置。这里没有显示的是注释掉的!:
ufw
Status: active
To Action From
-- ------ ----
[ 1] 9090/tcp ALLOW IN Anywhere # UBUNTU-COCKPIT
[ 2] 3306/tcp ALLOW IN Anywhere # MYSQL
[ 3] Apache Full ALLOW IN Anywhere # :80,:443
[ 4] Bind9 ALLOW IN Anywhere # :53
[ 5] OpenSSH ALLOW IN Anywhere # :22
[ 6] 8080:8090/tcp ALLOW IN Anywhere # TOMCAT
[ 7] 9090/tcp (v6) ALLOW IN Anywhere (v6) # UBUNTU-COCKPIT
[ 8] 3306/tcp (v6) ALLOW IN Anywhere (v6) # MYSQL
[ 9] Apache Full (v6) ALLOW IN Anywhere (v6) # :80,:443
[10] Bind9 (v6) ALLOW IN Anywhere (v6) # :53
[11] OpenSSH (v6) ALLOW IN Anywhere (v6) # :22
[12] 8080:8090/tcp (v6) ALLOW IN Anywhere (v6) # TOMCAT/etc/主机
127.0.0.1 localhost.localdomain localhost
127.0.1.1 ubuntu
127.0.1.1 thats-my.app(-->没有IPv6条目)
/etc/apache2/站点-现有/那-my.conf
ServerName thats-my.app
ServerAlias thats-my
ProxyRequests Off
Order deny,allow
Allow from all
ProxyPreserveHost On
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/->指向启用站点目录的符号链接
/etc/bind/named.conf.
zone "thats-my.app" IN {
type master;
file "/etc/bind/forward.thats-my.app.db";
allow-update { none; };
};
zone "178.168.192.in-addr.arpa" IN {
type master;
file "/etc/bind/reverse.thats-my.app.db";
allow-update { none; };
};/etc/bind/named.conf.选项
options {
directory "/var/cache/bind";
forwarders {
1.1.1.1;
1.0.0.1;
8.8.8.8;
8.8.4.4;
};
dnssec-validation auto;
listen-on-v6 { any; };
allow-query { any; };
};/etc/bind/my.app.db.这是-my.app.db
$TTL 604800
@ IN SOA ns1.thats-my.app. admin.ns1.thats-my.app. (
5 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns1.thats-my.app.
ns1 IN A 192.168.178.23/etc/bind/Reverse.该段-my.app.db
$TTL 604800
@ IN SOA thats-my.app. admin.thats-my.app. (
4 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns1.thats-my.app.
ns1 IN A 192.168.178.23
23 IN PTR ns1.thats-my.app.->输入终点站:
sudo systemctl restart named
sudo systemctl restart apache2
sudo systemctl restart bind9->路由器中的DNS配置
将DNS IPv4 IP设置为192.168.178.23 (主和次要)
将DNS IPv6 IP设置为ubuntu计算机的IPv6地址(主计算机和辅助计算机)
以下是我得到的:
关于本地Ubuntu-Server
$ curl thats-my.app -> OK
$ dig thats-my.app -> status: NOERROR *but* SERVER 1.1.1.1#53 ???
$ dig thats-my.app @127.0.1.1 -> "connection timed out!"
$ dig thats-my.app @192.198.178.23 -> "connections timed out!"浅谈局域网Windows
curl thats-my.app -> cannot be resolved局域网Windows-PC Chrome浏览器
http://thats-my.app ->网站无法访问/ DNS_PROBE_FINISHED_NXDOMAIN
如果你看一下“挖掘”--结果让我觉得Bind9在这里不起作用。你认为如何?
谢谢!
发布于 2021-10-09 19:54:27
我终于找到了一个解决方案:路由器("AVM Fritz!Box",在德国很常见)有一个安全特性“DNS -重新绑定-保护”,它阻止DNS请求从局域网内部到局域网内的另一个主机。当您通过在文本框中键入TLD "lan“或上面的"app”设置异常时,您的本地DNS服务器工作得非常好。你可以把货代移走。
PS:你不需要进入/etc/主机!
PPS:https://bind9.readthedocs.io/en/latest/index.html
祝好运!
https://serverfault.com/questions/1079731
复制相似问题