大网数据广告活动
服务器运维问答

Setting up a naked TLD in Bind

· 52CE 我爱测

I'd like to have a very short internal TLD, go , pointed at a webserver hosting a URL redirection app. For instance, a user could type go/chat or go/news without the need to remember what the exact URL is. I've set up my internal…

问题原文

原帖链接 · Mikey T.K. · CC BY-SA 4.0

I'd like to have a very short internal TLD, go, pointed at a webserver hosting a URL redirection app. For instance, a user could type go/chat or go/news without the need to remember what the exact URL is.

I've set up my internal DNS server with a zone file as follows:

$ttl 3600
go. IN  SOA localhost. dns.company.corp. (
            1597456469
            3600
            600
            1209600
            3600 )
go. IN  NS  localhost.
@   IN  A   10.0.88.10

From a Windows host using nslookup, this appears to work perfectly:

>nslookup go
Server:  dns1
Address:  10.0.40.10

Non-authoritative answer:
Name:    go
Address:  10.0.88.10

(with similar results on Linux)

However, no web browsers I've tried are able to resolve this name correctly. Chrome, Firefox, Edge, and IE all act as if this http://go domain name doesn't exist, that is, unless I include an extra period on the address (http://go.), upon which it resolves properly.

I've already tried the basics. Flushed DNS, rebooted, etc.

What's the right way to allow a "naked" TLD like this to be resolvable? Is this even possible?

已采纳解答

原帖链接 · Christopher H · CC BY-SA 4.0

The reason your browsers are showing a "non-existent domain" error when browsing to http://go is because they are appending a DNS suffix to the hostname (whether one exists, or the browser appends a null suffix). One still gets appended.

To achieve what you want to do, you need to either add the . to the end of the URL, so the browser sees it as an absolute address or configure a DNS zone e.g. example.internal, set the hostname for the webserver to go.example.internal, configure the DNS suffix on the PCs to example.internal (either manually or via DHCP) and then you can browse to http://go

Or you can add the hostname "go" to the hosts file of every PC that will need to connect to it.

http://www.dns-sd.org/TrailingDotsInDomainNames.html

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-08-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。