Help Center > > FAQs> Network Configurations> DNS and NTP Configurations> Does HUAWEI CLOUD Provide the NTP Server and How Can I Install It?

Does HUAWEI CLOUD Provide the NTP Server and How Can I Install It?

Updated at:Sep 10, 2020 GMT+08:00

Yes. HUAWEI CLOUD provides the NTP server, and it can only be installed and used on the ECSs that are purchased on the HUAWEI CLOUD management console.

You can install the NTP server provided on the management console or other NTP servers. The installation procedures are the same. This section describes how to install the NTP server provided on the management console on an ECS.

Background

If you use the NTP server provided by HUAWEI CLOUD, you also need to use the DNS server. Table 1 lists the NTP and DNS servers provided by HUAWEI CLOUD in different regions.

The clock server addresses used by HUAWEI CLOUD are as follows:

cn.pool.ntp.org

asia.pool.ntp.org

pool.ntp.org

hk.pool.ntp.org

Table 1 NTP servers

Region

NTP Server IP Address

DNS Server IP Address

CN North

ntp.myhuaweicloud.com

100.125.1.250

100.125.21.250

CN East

ntp.myhuaweicloud.com

100.125.17.29

100.125.135.29

CN South

ntp.myhuaweicloud.com

100.125.1.250

100.125.136.29

AP-Hong-Kong

ntp.myhuaweicloud.com

100.125.1.250

100.125.3.250

AP-Bangkok

ntp.myhuaweicloud.com

100.125.1.250

AP-Singapore

ntp.myhuaweicloud.com

100.125.1.250

100.125.128.250

AF-Johannesburg

ntp.myhuaweicloud.com

100.125.1.250

LA-Santiago

ntp.myhuaweicloud.com

100.125.1.250

100.125.0.250

LA-Sao Paulo1

ntp.myhuaweicloud.com

100.125.1.22

LA-Mexico City1

ntp.myhuaweicloud.com

100.125.1.22

Linux

  1. Check whether the IP address of the DNS server is correct on the ECS.

    1. Log in to the Linux ECS.
    2. Run the following command to open the resolv.conf file:

      vi /etc/resolv.conf

    3. Check whether the nameserver value in the file is the same as the IP address of the DNS server provided in Table 1.
      • If yes, go to 3.
      • If no, go to 2.

  2. (Optional) Configure the DNS server for the ECS.

    1. Log in to the Linux ECS.
    2. Run the following command to edit the resolv.conf configuration file:

      vi /etc/resolv.conf

    3. Add the following statement to configure the DNS server:

      nameserver IP address of the DNS server

      An example is provided as follows:

      Take the CN North region as an example. Add the following statement:

      nameserver 100.125.1.250

  3. Configure the NTP server for the ECS.

    1. Log in to the Linux ECS.
    2. Run the following command to edit the ntp.conf configuration file:

      vim /etc/ntp.conf

    3. Add the following statement to configure the NTP server:

      server Domain name of the NTP server

      An example is provided as follows:

      server ntp.myhuaweicloud.com

    4. Run the following command to start the NTP service upon system restart:

      For SUSE:

      service ntp restart

      For Euler and CentOS:

      systemctl restart ntpd

      Run the required command based on the OS running on the ECS.

    5. Run the following command to check whether the time on the NTP server has been synchronized with that on the upper-layer NTP server:

      ntpq -p

      If "*" is displayed, the time has been synchronized.

      It takes several minutes to perform NTP time synchronization for the first time.

    6. Set the automatic startup of the NTP service.

      For SUSE:

      chkconfig ntp on

      For Euler and CentOS:

      chkconfig ntpd on

Windows

Take an ECS running Windows 7 OS as an example.

  1. Log in to the ECS as user Administrator.
  2. Enable the local area connection.

    1. In the lower right corner of the taskbar, click the network connection icon.
    2. Click Open Network and Sharing Center.
    3. In the navigation pane on the left, click Change adapter settings.

  3. Configure the DNS server for the ECS.

    1. Double-click Local Area Connection.
    2. Click Properties in the lower left corner.
      Figure 1 Local area connection
    3. Select Internet Protocol (TCP/IP) and click Properties.
      Figure 2 Selecting a protocol type
    4. Select Use the following DNS server addresses and set the IP addresses of the DNS servers as prompted. Set Preferred DNS server to the IP address of the DNS server provided in Table 1.
      Figure 3 Setting the IP addresses of the DNS servers

  4. Configure the NTP server for the ECS.

    1. Press Win+R to start the Run text box.
    2. Enter regedit and click OK.

      The Registry Editor window is displayed.

    3. Modify the registry entries.
      • In HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ W32Time \ TimeProviders \ NtpClient, set the value of Enabled to 1, indicating that the NTP server is used.
      • In HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ W32Time \ TimeProviders \ NtpServer, set the value of Enabled to 0, indicating that the NTP server is stopped.
      • In KEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ W32Time \ Parameters, set the value of NtpServer to ntp.myhuaweicloud.com and that of TYPE to NTP.
      • In HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ W32Time \ TimeProviders \ NtpClient, set the value of SpecialPollInterval to 60 and that of Base to Decimal, indicating the clock synchronization cycle is 60s.
      • In HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ W32Time \ config, set the values of MaxPosPhaseCorrection and MaxNegPhaseCorrection to ffffffff and that of Base to Hexadecimal.
    4. Press Win+R to start the Run text box.
    5. Enter services.msc and click OK.

      The Service window is displayed.

    6. View the service named Windows Time and set the Start Type to Automatic to synchronize time from the NTP server.
    7. Press Win+R to start the Run text box.
    8. Run the following commands to restart the Windows Time service:

      net stop w32time

      net start w32time

    9. Manually change the time on the client to make it different from that on the NTP server. One minute later, check whether the time on the client is the same as that on the NTP server. If yes, the time is synchronized.

Follow-up Procedure

After the ECS is restarted, the DNS configuration is reset, and its IP address is changed to the IP address of the DNS server in the VPC subnet. Therefore, before restarting the ECS, check whether the DNS configuration in the VPC subnet is the same as the target DNS configuration. If they are different, modify the DNS configuration in the VPC subnet. For details, see Modifying a Subnet.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel