Many applications will involve FQDNs
What is the difference between a fqnd and a host that the salt gets to be different?
The FQDN
You can ' t change the FQDN (as returned by hostname--fqdn) or the DNS domain name (as returned by DnsDomainName) with this Command. The FQDN of
The system is the name of the resolver (3) returns for the host name.
The Technically:the FQDN is the name of the gethostbyname (2) returns for the host, name returned by GetHostName (2). The DNS domain name is the
The first dot.
Therefore It depends on the configuration (usually in/etc/host.conf) how can I change it. Usually (if the hosts file is parsed before DNS or
NIS) You can change it in/etc/hosts.
If a machine had multiple network interfaces/addresses or is used in a mobile environment and then it could either have Multip Le fqdns/domain names or
None at all. Therefore avoid using hostname--FQDN, hostname--domain and DnsDomainName. Hostname--ip-address is subject to the same limitations
So it should is avoided as well.
FQDN = short name + domain
For example: hostname Returns the result that the dev-qa001 domain is test.com and the FQDN is dev-qa001.test.com
command to return hostname
Hostname
command to return a field
DnsDomainName
command to return the FQDN
Hostname-f
Hostname-f-V
You can view detailed procedures for parsing
How to set the FQDN
Preferred method, method one set/etc/hosts
[Email protected] ~]# Cat/etc/hosts | Grep-i "Centos"
10.59.74.121 centos-6-121.test.com centos-6-121
First column IP second column fqnd third column host name (location not error, otherwise inconsistent results)
[[email protected] ~]# hostname centos-6-121[[email protected] ~]# Hostname-fcentos-6-121.test.com[[email protected] ~] # DnsDomainName test.com
Method Two: You configure DNS lookup through DNS
[Email protected] ~]# cat/etc/resolv.conf
Search a.pa.com
But your DNS must be able to parse your FQDN and return the invalidation (after you have removed the configuration in the hosts)
[Email protected] ~]# hostnamecentos-6-121[[email protected] ~]# dnsdomainname dnsdomainname:unknown host[[email Protected] ~]# hostname-fhostname:unknown host[[email protected] ~]#
If can parse, DnsDomainName for you to specify the search (can specify multiple, have a success can parse)
Three: Salt gets the FQDN when experience
The SALT-CALL-G is the most accurate through the Minion end.
Possible inconsistencies obtained through the master End Salt "dev-qa008" Grains.item FQDN
This article is from the "Tridewah operation and maintenance work Road" blog, please be sure to keep this source http://cuidehua.blog.51cto.com/5449828/1788240
about hostname and FQDN differences and how to get and set