这不起作用,因为 pg_hba.conf 中的 DNS 名称需要与您的 IP 地址的反向 DNS-IP-to-name- 查找结果相匹配:这是由您的连接提供商分配的,并且ddns 不触及它(只是提供额外的名称到 IP 的转发条目)。
This won't work, because the DNS name in pg_hba.conf needs to match the reverse DNS- IP-to-name- lookup result for your IP address: this is assigned by your connectivity provider, and ddns doesn't touch it (just provides an extra forward- name-to-IP- entry).
If you're using a version prior to that, you could write a cron-fired shell script that does the DNS lookup and dynamically creates the pg_hba.conf file. (You might have to do a HUP after changing it, not sure off the top of my head.)
发布评论
评论(2)
这不起作用,因为
pg_hba.conf
中的 DNS 名称需要与您的 IP 地址的反向 DNS-IP-to-name- 查找结果相匹配:这是由您的连接提供商分配的,并且ddns 不触及它(只是提供额外的名称到 IP 的转发条目)。This won't work, because the DNS name in
pg_hba.conf
needs to match the reverse DNS- IP-to-name- lookup result for your IP address: this is assigned by your connectivity provider, and ddns doesn't touch it (just provides an extra forward- name-to-IP- entry).我相信此功能是在 v9.1 中引入的:
http://www.postgresql.org/docs/9.1/interactive/auth-pg-hba-conf.html
如果您使用的是之前的版本,您可以编写一个 cron - 触发 shell 脚本执行 DNS 查找并动态创建 pg_hba.conf 文件。 (更改后您可能需要执行 HUP,但我不确定。)
I believe this functionality was introduced in v9.1:
http://www.postgresql.org/docs/9.1/interactive/auth-pg-hba-conf.html
If you're using a version prior to that, you could write a cron-fired shell script that does the DNS lookup and dynamically creates the pg_hba.conf file. (You might have to do a HUP after changing it, not sure off the top of my head.)