PING returns IP of one of my other servers for a non-existent domain
[root@monitor ~]# ping dsaDSADSADSAdsa.COM
PING dsaDSADSADSAdsa.COM.amitywebsolutions.co.uk (176.58.117.87) 56(84) bytes of data.
64 bytes from ac1.amitywebsolutions.co.uk (176.58.117.87): icmp_seq=1 ttl=63 time=5.48 ms
64 bytes from ac1.amitywebsolutions.co.uk (176.58.117.87): icmp_seq=2 ttl=63 time=0.737 ms
Its fine that there is a wildcard on my domain above so returns an IP, but why would pinging a random domain that does not exist append it to my website domain as a sub-domain? PINGing a domain thats up doesn't do that and works OK:
[root@monitor ~]# ping google.com
PING google.com (216.58.206.78) 56(84) bytes of data.
64 bytes from lhr35s11-in-f14.1e100.net (216.58.206.78): icmp_seq=1 ttl=58 time=1.40 ms
Thanks
8 Replies
> "domain Local domain name.
Most queries for names within this domain can use short names relative to the local domain. If no domain entry is present, the domain is determined from the local host name returned by gethostname(); the domain part is taken to be everything after the first '.'. Finally, if the host name does not contain a domain part, the root domain is assumed."
In /etc/resolv.conf I have:
search amitywebsolutions.co.uk
I changed it to the following which is copied from another server but it was overwritten by Network Manager. I had to disable Network Manager to save it.
nameserver 109.74.192.20
nameserver 109.74.193.20
nameserver 109.74.194.20
nameserver 8.8.8.8
nameserver 8.8.4.4
domain members.linode.com
options rotate
But now I cant connect to the server anymore even though its the same as another one.
I guess I need to edit NetworkManager to stop it adding that. Dont know how to do that yet, am looking into it. Must be linked to the server as none of my other servers have it, they all PING OK.
This one is set to Yes. But the /etc/resolv.conf file does not have the same comments that state it is created by Linode Network Manager.
So basically I dont know how to remove amitywebsolutions.co.uk search domain from NetworkHelper. On server reboot it now says this:
# Generated by NetworkManager
search members.linode.com amitywebsolutions.co.uk
nameserver 212.71.253.5
nameserver 178.79.182.5
nameserver 176.58.107.5
options rotate
You can disable and remove NetworkManager with the following commands (CentOS 7):
systemctl stop NetworkManager wpa_supplicant
systemctl disable NetworkManager wpa_supplicant
yum remove NetworkManager wpa_supplicant
systemctl enable network
If Network Helper is enabled via Linode Manager, then you'll get a new configuration script /etc/sysconfig/network-scripts/ifcfg-eth0 and a new resolver configuration /etc/resolv.conf.
4. Read /etc/resolv.conf
Compare the number of periods in the requested name to the value of "options ndots" (which defaults to 1) from the resolv.conf
If the number of periods in the requested name is less, then the following happens:
Append either the value of the domain entry or the first item of the search entry to the requested name (note: domain and search are mutually exclusive; whichever occurs last in resolv.conf is used)
Look up the modified name in DNS
If there are no results, and the search list is being used, repeat step 4 appending the next item of the search list
If there were still no results, then look up the original name directly
If the number of periods is more, then the original name is looked up first, and if there are no results, then the domain or search entries are used as above. So if your domain entry or search list contains a domain name that has a wildcard under it, you will always end up with a result. The only way to disable this behavior is to not have any domain or search entries in your resolv.conf (or the entries you do have not have a wildcard under them). This of course means you can't use hostnames to connect between hosts; you can work around this by making /etc/hosts entries for all of your hosts on each of them. This could be generated and maintained by a configuration management tool.
Initially I copied the Centos 7 script here, but that didn't work:
So I grabbed a copy from another server I have that has Network Manager disabled, and then adjusted the IPs, so I have the following. Guess some of the lines at the top was the issue as they are the only difference to Linodes tutorial. Removed DNS entries too but they did not affect the network:
DEVICE="eth0"
BOOTPROTO="static"
ONBOOT="yes"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
NM_CONTROLLED="no"
PEERDNS="no"
GATEWAY=12.34.56.1
IPADDR0=12.34.56.78
PREFIX0=24