Linux Settings Fqdn__linux

Source: Internet
Author: User


The FQDN is the abbreviation for fully qualified domain name, meaning the full domain name. For example, a machine host name (hostname) is www, and domain suffix (field) is example.com, the FQDN of the host should be www.example.com. In addition, the FQDN is finally "." To the end, but most applications and servers allow this last point to be ignored.

Linux allows users to view and set host names through the hostname command. The user can also get the FQDN of the host through the Hostname-f command. However, there is no command to set the FQDN directly. The following is a brief introduction to the Setup method.

First set the host name in the/etc/hostname file:

[root@localhost~]# Vi/etc/hostname

Elk

Then add a row of host records in the/etc/hosts file, the first field is the IP address of the host, the second field is the FQDN you want to set, and finally the host name you just set:

[root@localhost~]# vi/etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4localhost4.localdomain4

:: 1 localhost localhost.localdomainlocalhost6 localhost6.localdomain6

192.168.3.95elk.server.com Elk

Update the host name by Hostname-f/etc/hostname. To see the FQDN through Hostname-f:

[root@localhosttls]# hostname-f/etc/hostname

[root@localhosttls]# hostname-f

Elk.server.com

[root@localhosttls]# hostname

Elk

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.