Fixing DNS on Ubuntu server

1

I've got a server that is currently running as servername, but I need it to be servername.domain.com (the IP already resolves to servername.domain.com), and I currently have:

0.0.0.0 servername.domain.com

in /etc/hosts. What else do I need to do to get the server set up with the IP correctly?

This is the first time I've done anything like this - I can be more specific if needed.

If this is the wrong place to be posting this - please point me in the right direction.

U. Hudson

Posted 2011-06-14T04:18:28.940

Reputation: 11

Does your /etc/hosts really have the IP as 0.0.0.0, or is that something that you are using as a placeholder? What is the output of the hostname command. – Kirk – 2011-06-14T04:32:56.537

0.0.0.0 is a placeholder. servername is the output of hostname. – U. Hudson – 2011-06-14T04:34:23.510

So is the problem that you are trying to solve that servername.domain.com doesn't resolve from an additional host? or that the FQDN doesn't resolve from the server itself? Or is it more basic than that? Can you provide the output from a command that is problematic (other than hostname)? – Kirk – 2011-06-14T04:37:39.360

the IP resolves to servername.domain.com, however hostname lists servername, so it appears the server doesn't know it's real name (if that's the way to put it). This seems to be problematic for things such as running a mailer daemon. – U. Hudson – 2011-06-14T04:41:44.147

So if you ping server.domain.com from the server itself, it responds appropriately? None of my mail servers show their FQDN at the hostname command, or at the shell prompt. However, they all know what their FQDN is, and are able to reach it appropriately. Which mail server are you looking at? – Kirk – 2011-06-14T04:56:47.453

hostname is supposed to only list the name, not the FQDN. – user1686 – 2011-06-14T19:23:15.930

Answers

1

If you want to be able to go to another computer and type ssh servername.domain.com or point a web-browser at http://servername.domain.com, you should find your local DNS server (if any) and add the entry there to the DNS configuration files. If you don't have a local DNS server then you need to add the entry to every computers hosts file.

On the Ubuntu server you can add the domain to /etc/resolv.conf but there's probably a handy GUI configuration tool for doing this.

RedGrittyBrick

Posted 2011-06-14T04:18:28.940

Reputation: 70 632