个人工具

“UbuntuHelp:DynamicDNS”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(New page: {{From|https://help.ubuntu.com/community/DynamicDNS}} {{Languages|php5}} Parent page: Internet and Networking == Dynamic DNS == Every computer whi...)
 
第55行: 第55行:
 
<pre><nowiki>
 
<pre><nowiki>
 
gksudo gedit /etc/inadyn.conf
 
gksudo gedit /etc/inadyn.conf
</nowiki></code>
+
</nowiki></pre>
  
 
It should contain something like to the following:
 
It should contain something like to the following:
第65行: 第65行:
 
--alias myhost.dyndns.org
 
--alias myhost.dyndns.org
 
--background
 
--background
</nowiki></code>
+
</nowiki></pre>
  
 
Now test that it works by typing
 
Now test that it works by typing
第71行: 第71行:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo /usr/sbin/inadyn
 
sudo /usr/sbin/inadyn
</nowiki></code>
+
</nowiki></pre>
  
 
Next, add inadyn to your 'crontab':
 
Next, add inadyn to your 'crontab':
第78行: 第78行:
 
export EDITOR=gedit
 
export EDITOR=gedit
 
sudo crontab -e
 
sudo crontab -e
</nowiki></code>
+
</nowiki></pre>
  
 
Edit the file to add the following additional line:
 
Edit the file to add the following additional line:
第84行: 第84行:
 
<pre><nowiki>
 
<pre><nowiki>
 
@reboot /usr/sbin/inadyn
 
@reboot /usr/sbin/inadyn
</nowiki></code>
+
</nowiki></pre>
  
 
Then save and edit the editor. Verify using
 
Then save and edit the editor. Verify using
第90行: 第90行:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo crontab -l
 
sudo crontab -l
</nowiki></code>
+
</nowiki></pre>
  
 
When you reboot, you should see indyn listed when you type
 
When you reboot, you should see indyn listed when you type
第96行: 第96行:
 
<pre><nowiki>
 
<pre><nowiki>
 
ps -A | grep inadyn
 
ps -A | grep inadyn
</nowiki></code>
+
</nowiki></pre>
  
 
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/.
 
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/.
第116行: 第116行:
 
Please enter an update interval:[30] <interval time in minutes>
 
Please enter an update interval:[30] <interval time in minutes>
 
Do you wish to run something at successful update?[N] <N>
 
Do you wish to run something at successful update?[N] <N>
</nowiki></code>
+
</nowiki></pre>
  
 
Next, start the no-ip client
 
Next, start the no-ip client
第122行: 第122行:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo no-ip
 
sudo no-ip
</nowiki></code>
+
</nowiki></pre>
  
 
== Using your Modem for Dynamic DNS Reporting ==
 
== Using your Modem for Dynamic DNS Reporting ==

2007年5月13日 (日) 12:31的版本

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

It should contain something like to the following:

--username myusername
--password mypassword
--update_period 60000
--alias myhost.dyndns.org
--background

Now test that it works by typing

sudo /usr/sbin/inadyn

Next, add inadyn to your 'crontab':

export EDITOR=gedit
sudo crontab -e

Edit the file to add the following additional line:

@reboot /usr/sbin/inadyn

Then save and edit the editor. Verify using

sudo crontab -l

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

ps -A | grep inadyn

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.

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>

Next, start the no-ip client

sudo no-ip

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