1

My server is unreachable without "www." prefix, even when trying it with ping.

The DNS entry looks like this:

$TTL 86400
@   IN SOA ns1.first-ns.de. postmaster.robot.first-ns.de. (
    2011010600   ; serial
    14400        ; refresh
    1800         ; retry
    604800       ; expire
    86400 )      ; minimum

@                        IN NS      robotns3.second-ns.com.
@                        IN NS      robotns2.second-ns.de.
@                        IN NS      ns1.first-ns.de.

@                        IN A       1.2.3.4
localhost                IN A       127.0.0.1
mail                     IN A       1.2.3.4
www                      IN A       1.2.3.4
ftp                      IN CNAME   www
imap                     IN CNAME   www
loopback                 IN CNAME   localhost
pop                      IN CNAME   www
relay                    IN CNAME   www
smtp                     IN CNAME   www
@

A DNS record of the same type for another domain on the same server is working with and without "www".

And the VirualHost config looks like this:

<VirtualHost *:80>
        ServerName somewhere.com
        ServerAlias www.somewhere.com

</VirtualHost>

An nslookup for www.somewhere.com and somewhere.com shows different IPs! The wrong IP is from a former version of the DNS record. Maybe some DNS servers are not up to date, but I wonder why they are up to date with the www. version.

Any idea what could be wrong?

deamon
  • 121
  • 3

3 Answers3

1

In addition to incrementing the serial, as Chris S said in a comment, one small step often overlooked by those who don't work with DNS routinely is telling the DNS server to reload the file.

John Gardeniers
  • 27,262
  • 12
  • 53
  • 108
0

As far as I know, you only need the A record for www to resolve.

Hostname  IP Address 
           1.2.3.4 
mail       1.2.3.4 
www        1.2.3.4
c1tadel1
  • 51
  • 2
0

Since almost all answers came in form of comments, I have to repeat a comment to answer the question.

The solution was: Increment the serial after adding the default record.

deamon
  • 121
  • 3