Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two database servers where I can ping both by IP, but can only ping by name for one.

The setup:

  • Server1 - Original Data
  • Server2 - Receives data from Server1 through replication

Server1 can ping Server2 by IP and NAME.
Server2 can ping Server1 by IP but can't ping by NAME.

Why can't server2 ping server1 by name?

I need it because when I type the name of the database server, he doesn't recognize.

share|improve this question

migrated from stackoverflow.com Sep 23 '11 at 15:00

This question came from our site for professional and enthusiast programmers.

5 Answers 5

You have a name resolution problem. Based on what you've implied I'm assuming it's a DNS problem. Here are some steps to take:

  1. Identify your internal DNS server(s). Identify the appropriate DNS zone on the DNS server(s). Verifiy that the DNS zone is configured to allow dynamic updates. If this is an AD related zone you can allow secure updates only. If this is not an AD related zone then you need to allow both secure and unsecure updates.

  2. Make sure that both database servers are configured to use the DNS server(s) identified in step 1 for DNS name resolution.

  3. Make sure that both database servers are configured with a DNS suffix that matches your DNS zone. This will be the case if this is an AD domain and both database servers are joined to the domain.

  4. Verify that the correct A (host) records are registered in the DNS zone for both database servers. If they aren't registered or if they aren't correct, then delete the incorrect record and reregister it from the applicable server by running ipconfig/registerdns from a command prompt.

share|improve this answer

There are a lot of options here. But here's where I'd start:

  • What does nslookup server1 return? If it's not the IP that you're looking for or returns empty, then that's your problem
  • What about tracrt server1? It might stop at some point, which would point you in the direction of where the problem is.
  • Since we're talking about databases, have you tried to telnet to the port that sql server runs on on server 1 from server 2? That's all that ultimately matters (the rest you can get around).
share|improve this answer
    
I'm thinking about firewall. Can be an option ? –  Lucas Germano Sep 23 '11 at 14:48
    
Tracert is OK, but the name of server2 showed at the final of the tracert is different of the name of the machine. –  Lucas Germano Sep 23 '11 at 14:56
    
If you can ping by ip address but not by name then it's not a firewall issue. It's a name resolution issue. –  joeqwerty Sep 23 '11 at 15:43
    
Because firewalls can't block port 53, can they... –  Safado Sep 23 '11 at 16:12
    
Sure they can but think about the scenario where this would be the case: 1. Firewall on Server2 blocks outgoing DNS queries or blocks incoming DNS responses. 2. DNS server blocks incoming DNS queries, but only from Server2 (because Server1 doesn't have a name resolution problem). It's possible but not probable that a firewall is causing the problem. In addition, tracert is resolving the name, albeit incorrectly, which tells me that there isn't a firewall blocking name resolution otherwise tracert would also fail to resolve the name. –  joeqwerty Sep 23 '11 at 17:00

Try flushing dns resolver cache. If on Windows - start - run - ipconfig /flushdns from server2.

share|improve this answer

This sounds like a name resolution problem. Are both machines using the same DNS server, and are all of the names correctly registered?

share|improve this answer
1  
Seems like Joe covered this pretty well 4 hours ago. Any new ideas to add? –  Chris S Sep 23 '11 at 19:33

Best practice is you add each server's IP and hostname to both server's hosts file.

For example, if your servers run Windows, then open up C:\Windows\System32\drivers\etc\hosts with Notepad and add:

192.168.1.101     dbserver1.domain.com
192.168.1.102     dbserver2.domain.com

to both servers (of course on your hosts file you will add your IPs and hostnames).

share|improve this answer
1  
No, no, no! Hosts files are fine and good for testing/development purposes, but it is most definitely not a best practice to use them in lieu of fixing a broken DNS environment. –  EEAA Sep 24 '11 at 0:29
    
Why does a db server whose only purpose is to be part of a replication group, need a fully functional DNS environment? Why depend on another machine (dns server) when you only need to know 1 or 2 hostnames? –  George Tasioulis Sep 24 '11 at 8:17
    
@George: It's an assumption on your part that these two servers only need to communicate with each other and that they don't need to communicate with any other host or that no other host needs to communicate with them. As such, the use of hosts files is not best practice. Best practice is to have a fully and correctly functioning DNS infrastructure. –  joeqwerty Sep 24 '11 at 13:21
    
Package updates, reverse DNS lookups, ntp to name a few. And if this is Windows, being on any sort of AD requires functional DNS. –  EEAA Sep 24 '11 at 16:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.