fully qualified domain name (FQDN) is the complete domain name for a specific computer, or host, on the Internet. The FQDN consists of two parts: the hostname and the domain name. For example, an FQDN for a hypothetical mail server might be mymail.somecollege.edu. The hostname is mymail, and the host is located within the domain somecollege.edu.

In this example, .edu is the top-level domain (TLD). This is similar to the root directory on a typical workstation, where all other directories (or folders) originate. (Within the .edu TLD, Indiana University Bloomington has been assigned the indiana.edu domain, and has authority to create subdomains within it.)

The same applies to web addresses. For example, www.indiana.edu is the FQDN on the web for IU. In this case,www is the name of the host in the indiana.edu domain.

When connecting to a host (using an SSH client, for example), you must specify the FQDN. The DNS server then resolves the hostname to its IP address by looking at its DNS table. The host is contacted and you receive a login prompt.

If you are using only the hostname (without the domain information) to connect to a server, the application you're using may not be able to resolve the hostname. This can happen if either the DNS suffix search order in your computer's TCP/IP properties is incorrect, or the DNS table is corrupted. In these cases, entering the host's FQDN will allow DNS to locate the server. Also, if you are trying to connect to a remote host that is not local to your Internet service provider (ISP), you will probably have to use the FQDN. For example, it's unlikely that a DNS server at IU would have a listing for remote hosts at another university or an unrelated ISP.

FQDN是Fully Qualified Domain Name的缩写, 含义是完整的域名. 例如, 一台机器主机名(hostname)是www, 域后缀(domain)是example.com, 那么该主机的FQDN应该是www.example.com.

题外话, 其实FQDN最后是以"."来结尾的, 但是大部分的应用和服务器都允许忽略最后这个点.

Linux允许用户通过hostname命令查看并设置主机名. 用户也可以通过hostname -f命令得到该主机的FQDN. 但是, 却没有直接设置FQDN的命令.

实际上, 设置Linux的FQDN可以通过两种方法实现.

第一种, /etc/hostname + /etc/hosts文件组合

首先在/etc/hostname文件中设置主机名, 假设是

www

然后在/etc/hosts文件中增加一行主机记录, 第一个字段是该主机的IP地址, 第二个字段是你希望设置的FQDN, 最后是刚刚设置的主机名, 如下

A.B.C.D www.example.com www

设置好之后, 通过hostname -F /etc/hostname更新主机名. 这时, 通过hostname -f看到的FQDN就应该是: www.example.com

第二种, /etc/hostname + /etc/resolv.conf组合

如果Linux不能在/etc/hosts文件中找到hostname对应的记录, 就会试图从resolv.conf文件中得到主机的域名后缀(domain name). 例如, 这样的/etc/resolv.conf文件

domain example.com 
search example.com 
nameserver W.X.Y.Z

根据配置文件中的domain后缀example.com, 加上主机名www, Linux会试图自动拼接成一个候选FQDN:www.example.com. 但这个候选FQDN还需要进一步验证.

Linux通过DNS服务器W.X.Y.Z解析候选FQDN, 如果解析失败, 生成FQDN过程就失败了. 如果解析成功, 则会返回www.example.com这个域名的正式名称. 也就是说, 如果在DNS服务器的记录中, www.example.com这个域名是指向server.example.com的CNAME记录的话, 而server.example.com才是A记录. 返回的FQDN就是server.example.com, 而不是www.example.com.

以上就是Linux下设置FQDN的方法.

FQDN:(Fully Qualified Domain Name)完全合格域名/全称域名,是指主机名加上全路径,全路径中列出了序列中所有域成员。全域名可以从逻辑上准确地表示出主机在什么地方,也可以说全域名是主机名的一种完全表示形式。从全域名中包含的信息可以看出主机在域名树中的位置。DNS解析流程:首先查找本机HOSTS表,有的直接使用表中定义,没有查找网络连接中设置的DNS 服务器由他来解析。

例如,acmecompany公司的Web服务器的全域名可以是 acmecompany.,而若sales主机是在销售部子域,则它的全域名可以是sales.acmecompany。当给出的名字像acmecompany而不是acmecompany.时,他们通常是指主机名,而名字后边带有点号(“.”是指根域名服务器)的则认为是全域名。这种区别在理解和控制解析过程时是非常重要的。点号实际上指出了域名树的根。

全域名在实际中是非常有用的。电子邮件就使用全域名作为收信人的电子邮件地址,如janicejones@ acmecompany. com,其中收信人为janicejones,跟在收信人名字后面是符号@,@后面是邮件服务器的全域名,或者说是邮件服务器所在企业的域名,最后是顶层域名.com。. com意味着acmecompany是一个商业机构。

与URL的区别在于协议头”Http://”。

What is a fully qualified domain name (FQDN)?的更多相关文章

  1. 解决Apache启动错误:httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

    启动apache遇到提示: [root@bqh-119 conf]# ../bin/apachectl -thttpd: apr_sockaddr_info_get() failed for bqh- ...

  2. 源码安装Apache,报错:Cannot use an external APR with the bundled APR-util和httpd: Could not reliably determine the server's fully qualified domain name, using

    一.解决APR和APR-util错误: 1.1.安装APR: [root@ganglia httpd-2.2.23]# cd srclib/apr [root@ganglia apr]# ./conf ...

  3. 重启Apache报错apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName ... waiting的解决方法

    启动apache提示 : apache2: Could not reliably determine the server's fully qualified domain name, using 1 ...

  4. apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName的解决

    apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ...

  5. apache2: Could not reliably determine the server's fully qualified domain name

    错误信息:apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 ...

  6. Could not reliably determine the server's fully qualified domain name

    启动apache报错: [root@namenode1 ]# service httpd start Starting httpd: httpd: Could not reliably determi ...

  7. Starting httpd:Could not reliably determine the server's fully qualified domain name

    #service httpd start #Starting httpd: httpd: Could not reliably determine the server's fully qualifi ...

  8. apache启动问题: Could not reliably determine the server's fully qualified domain name

    [root@rusky]# service httpd startStarting httpd: httpd: apr_sockaddr_info_get() failed for ruskyhttp ...

  9. httpd: Could not reliably determine the server's fully qualified domain name

    作者:Younger Liu, 本作品采用知识共享署名-非商业性使用-相同方式共享 3.0 未本地化版本许可协议进行许可. 问题描述: AH00558: httpd: Could not reliab ...

随机推荐

  1. 【bzoj2662】[BeiJing wc2012]冻结 分层图Spfa

    原文地址:http://www.cnblogs.com/GXZlegend 题目描述 “我要成为魔法少女!” “那么,以灵魂为代价,你希望得到什么?” “我要将有关魔法和奇迹的一切,封印于卡片之中„„ ...

  2. hdu 2616 Kill the monster (DFS)

    Kill the monster Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  3. VS2013下配置OpenCV 3.0.0 &&& VS2013下配置Opencv2.4.9

    最近做图像需要用到Matlab和OpenCV,一些东西真的是要深入的研究进去才会有所发现,但Matlab和C++都不是我擅长的语言,所以要很加油很加油才行啊!! 步入正题. 1.  环境:Win7 6 ...

  4. Citrix NetScaler HA(高可用性)解析

    Citrix NetScaler HA(高可用性)解析 来源 https://www.iyunv.com/thread-172259-1-1.html 1.1     NetScaler高可用概述 我 ...

  5. H3C交换机端口链路聚合

    H3C交换机端口链路聚合 以太网链路聚合 -- 以太网链路聚合配置命令 -- lacp system-prioritylacp system-priority命令用来配置系统的LACP优先级.undo ...

  6. 虚拟机——vmtools安装出现Detected GCC binary at usr.bin.gcc.

    在安装VMWare Tools遇到过这样一个问题 Searching for GCC... Detected GCC binary at "/usr/bin/gcc". The p ...

  7. Guns V2.5

    Guns V2.5 新版Guns基于SpringBoot全面升级,完美整合springmvc + shiro + MyBatis 通用 Mapper + 分页插件 PageHelper + beetl ...

  8. linux正则表达式(一)

    正则表达式是一种字符串模式匹配,使用灵活.功能强大,使用简单的方式对字符串进行控制. 1.使用grep进行字符串匹配 测试文本 1.txt helloworld haa !@#$%^&*( A ...

  9. POJ3984 BFS广搜--入门题

    迷宫问题 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 20816   Accepted: 12193 Descriptio ...

  10. 汕头市队赛 SRM 09 A 撕书

    A 撕书I-3 SRM 09 背景&&描述 琉璃在撕书.     书总共有n页,都悬浮在数轴上,第i页的位置为,上面写着一个数字.     琉璃从右往左撕书.假如看到了第i页,就把在第 ...