Confused about hostname & FQDN and cannot connect to network

Issues related to hardware problems
Post Reply
hysterical
Posts: 3
Joined: 2015/07/02 23:03:43

Confused about hostname & FQDN and cannot connect to network

Post by hysterical » 2015/07/03 00:33:27

I have a Dell Poweredge 1950 that recently crashed and I had to import to restore. After the import many of my setting and software did not however. A friend had helped me with the initial setup and was not available to help me set it back up. So I preceded to try to set things back starting with the hostname and FQDN and from there I went on to networking, firewalls, NetworkManager and so on. Quit confused but eager to learn and fix it. In the process I couldn't connect via ssh any more so I started investigating by process of elimination and reading the many different articles with many different explanations of how to setup the network and get back on track. But I think I messed up more than I fixed because in:

nmtui
There are different interfaces than before. 2 of the same of which one being disabled (which I think is the correct one)then there is a new one called wired which is an inactive interface card on my system.

I think this all started with me not understanding the hostname and FQDN which I have changed several times (sorry, it's confusing as there is no real life explanations anywhere that I have found).

I read the rules but my server is offline so I cannot download the bat file. But my question is two fold.

1. Can anyone explain the hostname and FQDN and before you ask, yes I have looked it up, but example.com only confuses me more.
2. Would I be better off with a fresh install or can this be fixed?

Centos Linux release 7.1.1503 (Core)
I have 2 ethernet cards enp5s0 (inactive) & enp9s0 (active) but with 2 different settings in nmtui as follows:
enp9s0
TYPE="Ethernet"
BOOTPROTO="Static"
DEFROUTE="yes"
PEERROUTES="yes"
IPV4_FAILURE_FATAL="no"
IVP6INIT="yes"
IPV6_AUTOCONE="yes"
IPV6_PEERDNS="yes"
IVP6_PEERROUTES="yes"
IVP6_FAILURE_FATAL="no"
NAME="enp9s0"
UUID="24185xxa-8axx-4560-87xx-b785f3a1xxxx"
DEVICE="enp9s0"
ONBOOT="yes"

IPADDR=192.168.0.10
NETMASK=225.225.225.0
GATEWAY=192.168.0.1
DNS1=192.168.0.1
DNS2=8.8.8.8
DOMAIN=server

enp9s0-1
HWADDR=00:19:B9:xx:xx:FE
TYPE=Ethernet
BOOTPROT=none
DNS1=192.168.0.1
DNS2=8.8.8.8DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IVP6INIT=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=enp9s0
UUID=5f36cea4-a92f-4472-a3a8-a1c19d93ea20
IPADDR=192.168.0.10
PREFIX=32
GATEWAY=192.168.0.1

Notice there are no quotation marks after the equal signs on enp9s0-1 (not sure if it makes a difference)

hostname
server
FQDN
?
I want FQDN to be server.localcharmed

Hosts
127.0.0.1 server server.localcharmed localhost localhost.localdomain localhost4.localdomain4
::1 yada yada yada

I know you may need more info from me in order to help me re-establish my connection. If you could tell me specifically what you need it would be easier to type it all out then to randomly think you needed something and you didn't. As you probably guessed I'm a newbee, but very enthusiastic. My daughter thought she was doing me a favor when she vacuumed the server, but she put the hard disks back in the wrong slots and it crashed, which is why I need to know, should I just re-install Centos and start from scratch or is it savable? But I would still need the hostname and FQDN explained!

Thank you in advance!
Hysterical

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Confused about hostname & FQDN and cannot connect to net

Post by aks » 2015/07/03 19:01:28

To answer the first question ('cause it's to long - didn't read):
Full Qualified Domain Name (fqdn):
johncharles.google.com
Hostname (also sometimes called short name):
johncharles
Domain name:
google.com
See? The dots separate them - the stuff from the beginning to the first dot is the hostname, from then on, where's talking domain names. I guess where it can get confusing is the idea of sub-domains.
johncharles.email.google.com
IN this case my hostname is still johncharles, but my domain (DNS wise) is email.google.com, which in turn is a subdomain of google.com (note the dots), whoich in turn is a sub-domain of com
The resolver works "backwards". Start at the end (.com) - who is .com, ask them for the net part (google in the example), so ask ./com who is google.com. Get answer, then ask who is google.com, get an answer, then ask who is email.google.com and finally who is johncharles.email.google.com
See?

hysterical
Posts: 3
Joined: 2015/07/02 23:03:43

Re: Confused about hostname & FQDN and cannot connect to net

Post by hysterical » 2015/07/04 03:27:11

If, I understand correctly a FQDN is indeed a registered actual domain name like google.com, correct? So, if I am using a service like freedns.afraid.org, I could use server.strangled.com, correct?

Thank you in advance

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Confused about hostname & FQDN and cannot connect to net

Post by aks » 2015/07/04 10:57:28

If, I understand correctly a FQDN is indeed a registered actual domain name like google.com, correct?
Yes, but not necessarily so. I could make up a domain name like qwerty.com (that actually does exist, I konow because I asked Google's DNS - but let's pretend it is not a known domain to the Internet's DNS system). All that means is that I can use my own DNS resolvers to resolve the name to IP address, but because the Internet's DNS doesn't know of it, the Internet can not resolve my address and will not connect (unless they put the IP address in directly). Just because DNS address is a FQDN, does not mean it is part of the global DNS namespace - in other words a given FQDN amy or may not be known to the global (Internet) DNS system.

So if you're using a DNS service, they'll be responsible for the "glue" to put your DNS entries into the global address namespace.

Let's see if we can resolve server.strangled.com (I usually use Google's DNS - 8.8.8.8):
dig @8.8.8.8 IN A server.strangled.com

; <<>> DiG 9.9.4-P2-RedHat-9.9.4-18.P2.fc20 <<>> @8.8.8.8 IN A server.strangled.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12275
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;server.strangled.com. IN A

;; ANSWER SECTION:
server.strangled.com. 299 IN A 69.172.201.208

;; Query time: 181 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sat Jul 04 11:52:22 BST 2015
;; MSG SIZE rcvd: 65

So that address resolves to 69.172.201.208 (note that in the DNS namespace the domain ends with a final dot).

hysterical
Posts: 3
Joined: 2015/07/02 23:03:43

Re: Confused about hostname & FQDN and cannot connect to net

Post by hysterical » 2015/07/04 11:17:42

Ok, so I bought a domain name charmedxxxx.com I want it to be my FQDN with server as host name. Correct?

Will I use the nmtui tool to set server.charmedxxxx.com as my FQDN because I think what confuses me most is changing host and hostnames I was thinking they were two separate files and in two different places to complete FQDM. BTW if I turn off NetworkManager I lose all of my ip setting on reboot. Is that because I have the system confused? I can get them back when I use dhclient -r and dhclient enp9s0 and everything works sort of. Is this problem related to FQDN?

Again Thank you its getting clearer.

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Confused about hostname & FQDN and cannot connect to net

Post by aks » 2015/07/05 17:42:04

Ok, so I bought a domain name charmedxxxx.com I want it to be my FQDN with server as host name. Correct?
Yes, as in server1.charmedxxxx.com.
BTW if I turn off NetworkManager I lose all of my ip setting on reboot. Is that because I have the system confused?
Sort of, the "legacy" way of specifying IP details is not the same as when you use NetworkManager (they seem to be fairly separate things).
I can get them back when I use dhclient -r and dhclient enp9s0 and everything works sort of. Is this problem related to FQDN?
Maybe, what happens when you use NetworkManager and when you just get the info from DHCP? Specifically, in term of hostname (short name), FQDN, IP address and gateway?

Post Reply