Name resolution

Hi,

I know this topic has been discussed before but my problem is somewhat unique and I’m having some trouble finding a resolution.

My network consists of the following servers:

  • Windows Server 2003 - AD, DHCP, DNS
  • openSUSE 11 (text mode) - Apache, Joomla
  • openSUSE 11 (text mode) - MySQL
  • Windows XP client used for administration

The main problem I’m having has to do with the Joomla installation where it asks for the MySQL hostname. If I put my hostname, then Joomla is not able to find it. I believe this has to do with a name resolution issue. I can ping the MySQL host by IP but not by hostname.

I configured the network settings via Yast. I have my nameserver (Windows Server) and my ISP nameservers entered. The linux servers are not Windows domain members. Firewalls are disabled on the linux servers.

Should linux register it’s hostname(s) with the Windows DNS server or is that something that has to be manually configured? My thinking is that if I cannot ping a linux server by hostname, then Joomla will never see the server.

Hi,

You almost got to the solution.

A linux box uses two main procedures to resolve names:

dns
hosts

For a given host name to be resolved, the name must be registered locally in /etc/hosts or in a dns server.

You don’t seem to have added an entry for your failed hostname in /etc/hosts nor in the Windows DNS.

That is the problem. One of them has to have the mapping between the name and the corresponding IP address.

In addition, double check that /etc/resolv.conf contains the IP address of your DNS server.

Verify also that /etc/nsswitch.conf contains a line like this:



hosts: files dns

Hope this helps.

Regards.

Should there be entries in the hosts files of all linux servers? On a small scale this seems like a suitable solution. If someone were setting up an enterprise, isn’t there a better way of doing this? I don’t think it would be best practice to manually manage all of your linux server’s hosts files.

I will have to make an entry in the Windows DNS due to the fact I am using a Windows client to administer the system.

Yeah, add the hosts to the DNS server, that’s the way to do it for an enterprise.

Ok, I added new A-records for all linux servers into DNS on the Windows server. I added entries into the hosts files of all linux servers. From the WinXP client, I can ping the primary apache server, mysql server, and ssh server. I cannot ping the apache secondary server (this server will replace the primary once joomla is running).

Through yast I have configured a static IP, hostname, gateway IP, local and ISP DNS IP and disabled the firewall. The apache service is running and will automatically restart upon reboot. I have rebooted several times too.

Does anyone have any ideas what I should check next? It seems like all the linux network devices are configured the same. I have a feeling I might be missing something basic.

Try this:

put

mdns off

into /etc/host.conf

and:

In /etc/dhclient.conf

send host-name "yourhostname";

on your opensuse 11 boxes

The mdns service is not installed and /etc/dhclient.conf doesn’t exist. You can configure send hostname in yast which I did. I restarted my secondary webserver and I still cannot ping it.

What happens if you do an nslookup on the host which is not pingable?

I have a similiar issue to this, running opensuse 11 and using Suse Enterprise 10.1 as a router/dns/dhcp/gateway etc. When I ran xp I could reach the router by name i.e. nikki, but now that I am running Suse 11 nikki doesnt work anymore, I have to use the ip, nslookup fails both directions (cannot get to my desktop from the router or to the router from my desktop by name, only using ip)[windows machines can see the router but not the desktop by name, i can get to windows boxes by name from any machine]. nikki has a static ip so I can see that maybe I need to add an entry for it in the host file, but why did it work when I ran XP? Windows can clearly not do something more intelligent then linux an it?

nslookup responded with some FQDN in beaverton oregon. I found if I ran ipconfig /flushdns followed by ipconfig /registerdns, then I can ping the secondary webserver by name. I will try a Joomla install again and see if that application can find the SQL server now. Significantly more configuration has been completed compared to my first attempt.

I think I need to do more research on DNS to understand it better. I don’t think I totally understand how to get this setup properly but I have definitely learned something from this thread.

Thanks everyone for your help! If I can come up with a solid solution, I’ll be sure to post it.

nslookup responded with some FQDN in beaverton oregon. I found if I ran ipconfig /flushdns followed by ipconfig /registerdns, then I can ping the secondary webserver by name. I will try a Joomla install again and see if that application can find the SQL server now. Significantly more configuration has been completed compared to my first attempt.

I think I need to do more research on DNS to understand it better. I don’t think I totally understand how to get this setup properly but I have definitely learned something from this thread. What I need to get a clear understanding of is how to get the local DNS to respond to requests for local computers. My network seems to want to look externally even though my internal DNS has an A-record for the server I’m pinging and the internal DNS is set as primary.

I have the Windows DHCP server configured to provide my ISP DNS server IP addresses. Should I configure my internal DNS to pass off requests to the ISP when it doesn’t have an answer? Would that be something different than an A-record?

Thanks everyone for your help!

When you have an internal DNS resolver there are several things to keep in mind.

  • All queries must be chained through the internal resolver. It won’t do to list the internal and external resolvers side by side in say /etc/resolv.conf. Variations in response speed will mean that some of the time you will get an answer for an internal domain and sometimes not.

  • You cannot force answers for zones for which you are not authoritative. If you serve zone foobar.localdomain, and you put:

web.example.com. IN A 1.1.1.1

in the zone file, 1.1.1.1 will not be given out as the answer for web.example.com. If you want to override an external zone, you must serve that zone, all of it, at least all the domain names which you care about. This is not recommended because you won’t keep up with any updates to example.com which is controlled by someone else.

The usual reason for overriding an external zone is that you own the zone and want to give different answers for internal and external queries, returning say a private IP for web.example.com from the inside, and a public IP for web.example.com from the outside, so that web page URLs, etc can be the same.

You can override external domain names in /etc/hosts but this is a Linux/Unix thing.

I changed the configuration of my DHCP server so that it now only provides the DNS IP of my internal server to clients. I had it configured to provide the DNS of my ISP DNS servers as well. I think that is what is confusing my network. After I renewed my IP from my DHCP server, I can now consistently and reliably ping all of my servers since adding A-records for all of the linux servers. It seems like even though you configure your linux network settings to look at the Windows DNS server that it as though they do not communicate. It works with the hosts files edited to include IPs of all other computers so I will just go with that.

Now that DNS seems to be straightened out I will continue with the Joomla install and see if can resolve the MySQL server by hostname.

Thanks to all who helped on this!