简体   繁体   中英

DNS treats IP address as hostname

I have 2 servers in the same LAN, which are hosted by hosting.com with its dns servers.

When I sent an http request from httpBuilder on machine A with destination(machine B) IP address, like RESTClient( http://XXX.XXX.XXX.XXX/foo/bar ), somehow in the DNS log shows the IP address was append with suffix like sna.hosting.com. So basically, a DNS query "XXX.XXX.XXX.XXX.static.sna.hosting.com" was sent, and obviously A/AAAA returned, which cost a very long time.

The question is why an IP address will still go to DNS query.

The hosts file on both machines are clean. The resolve.conf file on both machines just contain the dns servers ip.

One solution is just putting mapping entry in local hosts file, which works for this case but might not be long term one.

Any fresh thoughts?

This is because the hostname of both servers are set to an IP address. So the DNS server treats it as a FQDN. Solution is to assign the hostname with real hostnames.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM