Hi, I'm experiencing an interesting error when trying to ping or SSH to a host by using its FQDN. The problem is most annoying since I have multiple domains with similar hostnames so when I try to ssh to them, I need to make sure I'm hitting the right one. For example, I have mail servers at each of these domains I support called mx1.domain1.com, mx1.domain2.com, mx1.domain3.com...
Here are the contents of my /etc/resolv.conf file:
Using the host command, running `host mx1` returns the IP address of mx1.domain1.com, as expected, but of course, that's all it returns. Running `host mx1.domain1.com` returns the correct IP for the mail server in domain1.com, as well. Running `host mx1.domain2.com` returns the correct IP for the mail server in domain2.com. The 'host' command returns all the values one would expect it to. ping and ssh on the other hand, do not. I manage the DNS server at 10.1.1.2 and it has all the appropriate data in the bind zone files.
search domain1.com domain2.com domain3.com domain4.com
Here's what happens:
1. pinging mx1 returns successful ping results for the IP of mx1.domain1.com.
2. pinging mx1.domain1.com simply fails with an unknown host error; pinging mx1.domain2.com also fails with an unknown host error.
3. running ssh user@mx1 connects me to the mx1.domain1.com box
4. running ssh firstname.lastname@example.org, email@example.com... fails with "name or service not known" error.
If the host command resolves the IPs correctly, what's up with ping and ssh?
Thanks for your help.