PING returns IP of one of my other servers for a non-existent domain

On one of my servers I have a monitoring system I wrote, it uses curl to check other websites are up and running or not. Its worked fine for years, but recently, instead of returning the domain being down, its reporting a change of IP address. The IP address is one of my other servers. If I PING a non-existent domain from the server, it checks my other server and returns its default IP.

[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

Had a problem like this before. Make sure you have search and domain in /etc/resolv.conf set to members.linode.com.
> "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."

Ah, your suggestion was not quite right, but it allowed me to spot the issue!

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.

Using Lish I have got the old conf back by enabling NetworkManager again. But its adding in search domain amitywebsolutions.co.uk

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.

Some of my servers have Auto Configure Networking to Yes, some to No, in Linode, so it doesn't help copying any of those settings.

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

On my various servers, I always disable NetworkManager, because its easier to avoid NW related problems and its easy to configure.

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.

glibc's stub resolver behaves like this:

4. Read /etc/resolv.conf

  1. 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:

  2. 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)

  3. Look up the modified name in DNS

  4. If there are no results, and the search list is being used, repeat step 4 appending the next item of the search list

  5. 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.

@IfThenElse I had earlier disabled and stopped networkmanager with those commands but then lost the network to the server, even though /etc/resolv.conf looked fine, same as another server. Maybe it needs a restart, maybe need to disable network manager in Linode manager? Will try again later.

Ok got it working now, had to fiddle with the ifcfg-eth0 file.

Initially I copied the Centos 7 script here, but that didn't work:

https://www.linode.com/docs/networking/ … figuration">https://www.linode.com/docs/networking/linux-static-ip-configuration

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

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct