0

I have set my hostname like this:

$ sudo hostnamectl set-hostname dev.mydomain.com

and I see it got set when I do this:

$ hostnamectl status
   Static hostname: dev.mydomain.com
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 3e729c2d7c094902af0333ce40564ffe
           Boot ID: 68ed2ed21a55493785c1b11e2e6f11dc
    Virtualization: kvm
  Operating System: CentOS Linux 8 (Core)
       CPE OS Name: cpe:/o:centos:centos:8
            Kernel: Linux 4.18.0-147.3.1.el8_1.x86_64
      Architecture: x86-64

But when I pin the server from somewhere else (my desktop, or another remote machine) I see this:

$ ping dev.mydomain.com
PING dev.mydomain.com (my-servers-ip-address) 56(84) bytes of data.
64 bytes from some-other-domain-name (my-servers-ip-address): icmp_seq=1 ttl=59 time=20.0 ms

So the first line returned by ping correctly references dev.mydomain.com and it's IP address, but then it gets some other domain for the "64 bytes from..." part of the message

Where is some-other-domain-name coming from?

The machine is vhosting a number of websites as subdomains, so could that be related somehow?

What config files should I be checking?

Thanks

4
  • Is dev.mydomain.com a CNAME DNS record?
    – ceejayoz
    Jan 30, 2020 at 17:59
  • no ceejayoz, there are two A records, one for dev.mydomain.com and another for *dev.mydomain.com. I need the wildcard one for vhosting and the other so I can ssh, mysql, sftp connect to the server itself. Jan 30, 2020 at 18:10
  • Is the "other domain name" something completely random and unfamiliar to you, or is it something you recognize?
    – ceejayoz
    Jan 30, 2020 at 18:15
  • @ceejayoz it is something I recognize from the old server this new one replaces as it was a vhost domain used on that server Jan 30, 2020 at 18:30

1 Answer 1

2

I expect what is happening is the domain name is being resolved into an IP address, then the client is doing a reverse lookup of that IP which resolves the different name.

This set of reverse lookups uses a different set of mechanisms in the DNS infrastructure to the ones you appear to expect, namely ptr records set up in the special in-addr.arpa zone. To fix this globally you will need to work with the entity that controls this zone (normally the ISP providing the space).

1
  • nslookup my-server-ip-address gives ns1.linode.com. host my-server-ip-address gives li719-25.members.linode.com. dig -x 85.159.212.25 +noall +answer gives li719-25.members.linode.com. None of these equals the "other domain name" I get with ping @davidgo Jan 30, 2020 at 20:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .