Linux set FQDN

Source: Internet
Author: User
Tags fully qualified domain name

The FQDN is the abbreviation for fully qualified domain name, meaning the full domain name. For example, if a machine hostname (hostname) is www and the domain suffix is example.com, the FQDN of the host should be www.example.com. In addition, the FQDN is in fact the "." To the end, but most applications and servers allow the 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:

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:

VI /etc/hosts127.0. 0.1    localhost localhost.localdomain localhost4 localhost4.localdomain4::1         localhost Localhost.localdomain localhost6 localhost6.localdomain6192.168. 7.27 elk.server.com Elk

Update the hostname with HOSTNAME-F/etc/hostname. To see the FQDN through Hostname-f:

hostname -f/etc/hostnamehostname -hostnameElk

Linux set FQDN

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.