The key to this is going to be making sure that your DNS servers are responding with the same information for forward and reverse lookups, and that the server is configured to be reachable.
dig are two great tools to help determine if things are correctly configured.
My suggestion is to start with
dig -x 18.104.22.168 in order to find out what the DNS server is returning when queried for that address. If you get a server error, check your basic DNS configuration to make sure you are talking to the right servers. If you get a Not Found error, then you need to fix or create the reverse record for that IP address. The process for doing that can be complicated depending upon where your IP addresses are administered. For example, when using static IP addresses from an Internet provider, you often must have them create the mapping for you. However, when using private IP addresses behind a NAT, this is most commonly provided by an interna
Server. Either way, the basic form is going to be a PTR record of class IN which looks like
22.214.171.124.in-addr.arpa. IN PTR hostname.mydomain.com
Once your reverse is working, you should then verify that the forward request goes the same place. So, if your host name is www.foo.bar, then use
dig www.foo.bar to look up the IP address. It should resolve to the same IP address.
If the forward DNS for the host name you are using doesn't match the reverse DNS of the IP address you are using, server won't be happy.
One other thing to consider is the primary IP address of the machine. When considering the host name, I have often found that OS X wants to get the host name and IP address from the primary network interface. For OS X, the primary interface is the one that appears first in the Network control panel. If this is out of order, use the Set Service Order... command in the Network settings to change the order.