dd-wrt下载_如何使用带有DD-WRT的DNS名称访问计算机

dd-wrt下载

dd-wrt下载

We’ve shown you how to statically set the IPs on your network, now lets flip that DNS switch for added elegance and ease of use. Today’s guide will show you how to access your machines using DNS names on your DD-WRT enabled router.

我们已经向您展示了如何在网络上静态设置IP,现在让我们通过翻转DNS开关来增加美观性和易用性。 今天的指南将向您展示如何在启用DD-WRT的路由器上使用DNS名称访问计算机。

Image by Henk L

图片由Henk L提供

前言(Preface)

On our How To Set Up Static DHCP on Your DD-WRT Router guide, we’ve talked about making sure that your clients will always get the same IP address from the router. So now if you want to access one of the machines on your network, as you know it’s IP, you can use that… but using IPs just doesn’t have the same elegance as using names. Also, with the usefulness of “static IP”s dwindling due to the rise of UPnP, and the inconvenience of setting up “static reservations“ (having to find the MACs and alike)… What if you don’t want to remember IPs at all? That is where DNS comes in.

在“如何在DD-WRT路由器上设置静态DHCP”指南中,我们讨论了确保您的客户端始终从路由器获得相同的IP地址。 因此,现在,如果您要访问网络中的一台计算机,因为您知道它是IP,则可以使用它……但是使用IP并不像使用名称那样优雅。 另外,由于UPnP的兴起,“静态IP”的用处逐渐减少,以及设置“静态预留”(必须找到MAC等)的不便……如果您不想记住IP,该怎么办?所有? 这就是DNS出现的地方。

问题 (The Problem)

You’re trying to reach from one machine/device on your network to the other using its IP address (using ping for example) and it works. However, when trying to do the same using it’s hostname like “mydesktop” or “mylaptop”? it is a hit and miss… sometimes it works…. usually it doesn’t… :\

您正在尝试使用其IP地址(例如使用ping)从网络上的一台机器/设备连接到另一台机器/设备,并且该设备可以正常工作。 但是,当尝试使用其主机名(例如“ mydesktop”或“ mylaptop”)进行相同操作时? 这是一个命中注定的机会…有时很有效…。 通常不会...:\

到底是怎么回事? (What is going on?)

Your devices don’t know who and how they should ask for the “name” to “IP” translation, because they are missing a key configuration, the “DNS suffix”.

您的设备不知道由谁以及如何向他们询问“名称”到“ IP”的转换,因为它们缺少关键配置“ DNS后缀”。

When a computer needs to translate a name to an IP address (called “resolve”) it has a couple of ways to do it, one of the ways is to ask a Domain Naming System (DNS) server. However, to be able to do so, the client must ask the question in the form of a “Fully Qualified Domain Name” (FQDN).

当计算机需要将名称转换为IP地址(称为“解析”)时,它有两种方法可以使用,其中一种方法是询问域命名系统(DNS)服务器。 但是,为了做到这一点,客户必须以“完全合格域名”(FQDN)的形式提问。

An FQDN consists of the hostname like “mydesktop” and the DNS zone it belongs to like “geek.lan”. So in our example, the FQDNs for the hosts would be “mydesktop.geek.lan” and ”mylaptop.geek.lan” respectively. When a client doesn’t have the “DNS zone” at hand, it is unable to ask the DNS about a  “flat” name (a name that doesn’t specify the “DNS zone”). That is, to actually reach your host by name, you would need to ping “mydesktop.geek.lan”. However, if the DNS suffix was defined in some way (either manually or automatically), the client will automatically try to append it to the requested hostname and ask a DNS server if it can help with the resolve. With that said, if the DNS suffix is not defined, the client does try to find out the name on its own, using a “DNS broadcast”. The problem with that is that not all clients are configured to answer, or are actually configured to deliberately not answer such a request. In contrast, it would simply be annoying to specify the FQDN every single time.

FQDN由主机名(如“ mydesktop”)和它所属的DNS区域(如“ geek.lan”)组成。 因此,在我们的示例中,主机的FQDN分别为“ mydesktop.geek.lan”和“ mylaptop.geek.lan”。 当客户端手边没有“ DNS区域”时,它就无法向DNS询问“平面”名称(该名称未指定“ DNS区域”)。 也就是说,要通过名称实际到达主机,您需要ping“ mydesktop.geek.lan”。 但是,如果以某种方式(手动或自动)定义了DNS后缀,则客户端将自动尝试将其后缀附加到所请求的主机名,并询问DNS服务器是否可以帮助解决该问题。 话虽如此,如果未定义DNS后缀,则客户端确实会尝试使用“ DNS广播”自行查找名称。 这样做的问题是,并非所有客户端都被配置为应答,或者实际上不是被配置为故意不应答这样的请求。 相反,每次指定FQDN只会很烦人。

解决方案 (The solution)

In order to have the full infrastructure that will fix this problem, one only needs to set the “DNS suffix” on the “DHCP scope” of the *router. Doing so will both make it so the router will now have a “dynamic DNS” server service that clients can register themselves to, make it so the DHCP service it self will do the same for none-self-registering hosts and deliver the “DNS suffix” as part of the “DHCP lease” given to the clients. Therefore making the entire solution a self sustaining, default behaving solution that solves all the problems in one fail swoop…. neat, A?

为了拥有可以解决此问题的完整基础结构,只需在*路由器的“ DHCP作用域”上设置“ DNS后缀”。 这样做都将使路由器现在具有一个“动态DNS ”服务器服务,客户端可以将其注册到服务器上,使其自身的DHCP服务将对非自注册主机执行相同的操作并提供“ DNS”后缀”作为提供给客户端的“ DHCP租约”的一部分。 因此,使整个解决方案成为一种自我维持,默认的行为解决方案,可以一举解决所有问题……。 整洁的,A?

*When using DD-WRT… with other routers, your mileage may vary.

*将DD-WRT…与其他路由器一起使用时,您的行驶里程可能会有所不同。

To do this, go into your router’s Administration page:

为此,请进入路由器的“管理”页面:

dhcp suffix1
  1. Go into –>  Services

    进入–>服务
  2. Change, “Used Domain” to be “LAN & WLAN”

    将“使用的域”更改为“ LAN&WLAN”
  3. Choose a Domain name, we’ve used “geek.lan” for this example, but you can use *whatever you want.

    选择一个域名,在此示例中,我们使用了“ geek.lan”,但您可以随意使用*。
  4. While using Static DHCP reservations is optional for this procedure, if you chose to implement it, it is recommended that you set the hostname, to match the one that is set on the machine/device’s OS. Now if it just so happens that the devices OS, doesn’t register a name in DNS (like phones) this is a good way to force one on it.

    虽然对于此过程,使用静态DHCP保留是可选的,但如果选择实施,则建议您设置主机名,以与在计算机/设备的OS上设置的主机名相匹配。 现在,如果碰巧设备OS不在DNS中注册名称(例如电话),这是在其上强制使用名称的好方法。

  5. Click “Save” –> “Apply Settings”.

    单击“保存” –>“应用设置”。

*The one exception to that rule, is that if you use “.local”, while your windows machines will probably do just fine, your Linux machines will adhere to the mDNS (Multicast DNS) standard and will again ignore the DNS server. There is a workaround, but it’s beyond the scope of this guide.

*该规则的一个例外是,如果您使用“ .local”,则Windows计算机可能会正常运行,而Linux计算机将遵循mDNS(多播DNS )标准,并且将再次忽略DNS服务器。 有一种解决方法,但这超出了本指南的范围。

Now to check that the settings have taken affect, go to the command line and issue an “ipconfig”.

现在要检查设置是否生效,请转到命令行并发出“ ipconfig”。

You should see that your DNS suffix is currently none-existing as below:

您应该看到您的DNS后缀当前不存在,如下所示:

dhcp suffix2

Issue an “ipconfig /release” followed by an “ipconfig /renew”, and you should see something like:

发出“ ipconfig / release”,然后发出“ ipconfig / renew”,您应该看到类似以下内容:

dhcp suffix3

Repeat the procedure on at least one more machine and try pinging, using only the hostname name.

在至少一台以上的计算机上重复该过程,并尝试仅使用主机名进行ping操作。

You should see that the client has “auto-magically” understood that the full name of the device you’re pinging is “hostname.dns.zone”, and was able to translate (resolve) the FQDN to a ping-able IP:

您应该看到客户端“神奇地”了解到您要ping的设备的全名是“ hostname.dns.zone”,并且能够将FQDN转换(解析)为可ping的IP:

dhcp suffix4

故障排除 (Troubleshooting)

As this guide is about using DNS like the How to Remove Advertisements with Pixelserv on DD-WRT guide was, If you run into problems there are a couple of things to do:

正如本指南是关于如何使用DNS一样,如《如何在DD-WRT上使用Pixelserv删除广告》指南一样,如果遇到问题,则需要执行以下两项操作:

  • Clear your personal machines DNS cache.

    清除您的个人计算机DNS缓存。

    This is because of a DNS cache, that may fool your computer into thinking it already knows the hostname, without consulting the DNS for it. On windows this would be “ipconfig /flushdns”.

    这是因为存在DNS缓存,这可能使您的计算机误以为它已经知道主机名,而无需咨询DNS。 在Windows上,这将是“ ipconfig / flushdns”。

  • Make sure your client is using the router as the DNS and that it resolves the FQDN.

    确保您的客户端使用路由器作为DNS,并且它解析FQDN。

    Especially when using a VPN or a network that is more complex then the normal router to computer setup, it is possible that your client computer is simply not using the router as its DNS. It is very easy to see using the command “nslookup” below what is the DNS server the client is using. If the IP is not the same as the router, you have found the problem.

    尤其是当使用VPN或比通常的路由器到计算机设置更为复杂的网络时,您的客户端计算机可能根本就没有将路由器用作其DNS。 使用下面的命令“ nslookup”可以很容易地看到客户端使用的是什么DNS服务器。 如果IP与路由器不同,则您发现了问题。

    dhcp suffix5
Smile

That’s it… you should be all set

就是这样...您应该已经准备就绪



Hurry, all I see is darkness.

快点,我看到的只是黑暗

翻译自: https://www.howtogeek.com/69696/how-to-access-your-machines-using-dns-names-with-dd-wrt/

dd-wrt下载

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值