个人工具

UbuntuHelp:DynamicDNS

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月13日 (日) 11:21的版本 (New page: {{From|https://help.ubuntu.com/community/DynamicDNS}} {{Languages|php5}} Parent page: Internet and Networking == Dynamic DNS == Every computer whi...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索

Parent page: Internet and Networking


Dynamic DNS

Every computer which is attached to the internet has an IP address. DNS is the process of relating a name to an IP address so that a website or other service can be accessed using an easily-remembered named (like 'www.google.com'), rather than a number (like '192.168.0.1').

Most servers on the internet have a fixed IP address that never changes. This means that a 'static' DNS record can be set once such that it always redirects the DNS name to right place.

However, most home users will be assigned a dynamic IP address that will change periodically, or each time they connect to the internet. In the past this made it very difficult to make a home computer accessible from the broader Internet. But with an increasing number of "Dynamic DNS" service providers, this is not such a problem.

Dynamic DNS services offer you a DNS entry with a hostname of your choice. You are then responsible for updating the DNS entry whenver your IP address changes. This pages gives details about how to do that.

Registering with a Dynamic DNS provider

Dynamic DNS requires that a server somewhere on the internet keep track of 'where you are'. That is, it records your host name, and records what the IP address is that corresponds to your hostname.

Many Dynamic DNS provider offer a free service with a limited range of hostnames to choose from. Paid services will permit a larger selection of hostnames, including use of your own registered domain name.

So before you can get started using Dynamic DNS, you'll need to register with one of these such services. Here is a selection:

Upon registering, you will be provided with username and password, as well a hostname that you will be using as the DNS name that will allow external access to your machine.

Set up DNS Notification

Now that you have a DNS provider, you need to set up a way that your IP address will be updated whenever it is changed. There are two ways of doing this:

  • using the built-in capabilities of your Cable or DSL modem, or
  • using dynamic DNS software that you install on your computer

Try first to find out if your modem supports Dynamic DNS reporting/notification/updating. If your modem has a built-in 'website' you may find the necessary information by entering its IP address into your browser, for example http://10.1.1.1/ or http://192.168.01/

However, even if your modem does support dynamic DNS reporting, there are cases where you will need to use the second approach: perhaps you modem is too old, or perhaps you want the DNS entry to follow your *computer* around, rather than stay with your DSL/Cable connection.

Using your Computer to perform Dynamic DNS Notification

There are several alternatives. You may need to add the Ubuntu Universe to your set of software repositories. See InstallingSoftware for all the details.

inadyn

Install the inadyn package using Synaptic Package manager, then:

The following will allow your Ubuntu Linux machine to be accessible anywhere that you are given an externally-accessible IP address. This includes most ISPs but excludes many office LANs.

First edit the file /etc/inadyn.conf:

gksudo gedit /etc/inadyn.conf
</code>

It should contain something like to the following:

<pre>
--username myusername
--password mypassword
--update_period 60000
--alias myhost.dyndns.org
--background
</code>

Now test that it works by typing

<pre>
sudo /usr/sbin/inadyn
</code>

Next, add inadyn to your 'crontab':

<pre>
export EDITOR=gedit
sudo crontab -e
</code>

Edit the file to add the following additional line:

<pre>
@reboot /usr/sbin/inadyn
</code>

Then save and edit the editor. Verify using

<pre>
sudo crontab -l
</code>

When you reboot, you should see indyn listed when you type

<pre>
ps -A | grep inadyn
</code>

You should be able to log in to your Dynamic DNS provider's website and verify that the DNS entry is being updated. Certainly this is possible with www.dyndns.org, in any case. Alternatively you can type your hostname into a service like http://www.dnsstuff.com/.

=== ddclient ===

More details required here. The documentation is good however, and there is a Ubuntu package for ddclient in the Ubuntu Universe, apparently.

http://ddclient.sourceforge.net/?page=0

=== no-ip ===

This is another Dynamic DNS reporting client.

<pre>
sudo no-ip -C
Please enter the login/email string for no-ip.com: <your_login>
Please enter the password for user 'your_login': <your_password>
Please enter an update interval:[30] <interval time in minutes>
Do you wish to run something at successful update?[N] <N>
</code>

Next, start the no-ip client

<pre>
sudo no-ip
</code>

== Using your Modem for Dynamic DNS Reporting ==

Here are some example screenshots from DSL modems that support dynamic DNS reporting:

Example:

 attachment:dyndns.jpg

Another example:

 attachment:routerdyn.jpg

----
CategoryDocumentation

[[category:UbuntuHelp]]