Koozali.org: home of the SME Server

SME6.0.1 - DNS not resolving 'self' addresses

Offline NickCritten

  • *
  • 245
  • +0/-0
SME6.0.1 - DNS not resolving 'self' addresses
« on: November 10, 2004, 03:07:07 PM »
Hi everyone...

Wierd problem on one of my sites...
I have the SME setup in Server-gateway.

The DNS server on the SME box is resolving external addresses fine, e.g www.google.com, www.contribs.org

But it does not resolve itself!

Hostnames I have set up are:
apollo.domain.com (servername)
mail.domain.com (Self)
webmail.domain.com (Self)
www.domain.com -> remote IP

If I do an nslookup from Windows, it returns
*** UnKnown can't find mail.domain.com: Non-existent domain

if I do if from the console I get
**Server cant find mail.domain.com: NXDOMAIN


I've tried restarting tinydns, deleteing and re-creating the hostnames, but still nothing...
This is quite urgent, has anyone any Ideas?

Cheers
...
Nick

"No good deed goes unpunished." :-x...

Offline Knuddi

  • *
  • 540
  • +0/-0
    • http://www.scanmailx.com
SME6.0.1 - DNS not resolving 'self' addresses
« Reply #1 on: November 10, 2004, 04:03:04 PM »
Windows stored the resolved DNS entries - you have to do a "Repair" on the LAN interface on XP or ipconfig /renew and then ipconfig /release on Win2k.

Also a reboot of the WIndows box should fix this.

Offline NickCritten

  • *
  • 245
  • +0/-0
SME6.0.1 - DNS not resolving 'self' addresses
« Reply #2 on: November 11, 2004, 09:50:24 AM »
Hi Knuddi,

Thanks for the reply, but sorry, but thats not it...
Its not the resolver cache that is interrogated when you do an nslookup/dig.. It accesses the DNS server directly.

When the Resolver cache is at fault, a Ping will give the wrong address, but an NSlookup will always give the address held on the DNS server.

Besides, its the whole site (500+ PC's) that are having this problem.

I've managed to get around this temporarily by creating another DNS zone on my 2003 server for the zone that the SME box is supposed to be resolving, and manually creating the A Records... But I'd prefer the SME to resolve itsself properly! :-)

Anyone else any Ideas?

Cheers!
...
Nick

"No good deed goes unpunished." :-x...

Mark_S

SME6.0.1 - DNS not resolving 'self' addresses
« Reply #3 on: November 11, 2004, 10:29:05 AM »
I wrote a HowTo on this but haven't gotten round to posting it anywhere yet.

Step 2 alone should fix your problem, but if you have any externally hosted sites using the same domain name, Step 3 will sort it for you also.

Took me ages aswell, there is a bug reported on this by the way, don't know if it was resolved though.

Quote

Resolving local domains and sub-domains on your SME Server.

Resolving sub domains for the same domain split between your SME server and your ISP.

For example, lets say that:

www.yourdomain.com is hosted at your isp.
ftp.yourdomain.com is hosted at your isp.
intranet.yourdomain.com is hosted on your SME server.
mail.yourdomain.com is hosted on your SME server.

If you try and ping www.yourdomain.com from your SME box, it WILL find it, because it is querying
your isp's name server, and your isp hosts www.yourdomain.com, so therefore it will return a valid
address for www.yourdomain.com

If you try and ping mail.yourdomain.com from your SME box, it WON'T find it, because it is querying
your isp's name server, and your isp does not host mail.yourdomain.com so therefore it won't return
a valid ip address for mail.yourdomain.com


To resolve this you need to do the following.

1. Add any domains and sub-domains to your SME server that are required by using "hostnames and
   addresses" in server-manager
2. Tell your SME server NOT to query your isp's DNS server for mydomain.com, but to query itself
3. Tell your SME server any exceptions to this rule by using the "hostnames and addresses" tab in
   the server-manager
4. Try pinging the addresses

-----------Here we go------------

We will use the above example for this explanation.

1. Adding a domain to the server-manager will have automatically set up mail, ftp, www etc for that domain
   in the hostnames and addresses tab already. These should all be pointing to self at the moment, however
   as stated above you will not be able to ping mail, or intranet from your SME box yet, as it won't resolve.

2. To tell your SME box to query itself, and not your isp for the domain mydomain.com:
   From the BASH Shell:
   cd /service/dnscache/root/servers
   echo 127.0.0.1 > mydomain.com
   svc -h /service/dnscache (This will flush the DNS Cache and must be performed)

   If you now ping ANY of the hostnames in the "hostnames and addresses" tab from your SME box, it
   should reply from the local ip address of your server, nslookups will also all resolve.

3. We now need to tell your SME server that www, and ftp are external addresses, so in the "hostnames and
   addresses" tab of the server manager, alter these to remote, and then point them to ip-address of your
   isp's webspace that hosts it.
   You then need to flush the DNS CACHE again:
   svc -h /service/dnscache

4. Now pinging:
   mail.mydomain.com should reply from your SME server
   intranet.mydomain.com should reply from your SME server

   www.mydomain.com should reply from your isp
   ftp.mydomain.com should reply from your isp

Even though they are the same domain.

Once this is set up, all further maintenance of mydomain.com can be done in "hostnames and addresses".


Mark

Offline NickCritten

  • *
  • 245
  • +0/-0
SME6.0.1 - DNS not resolving 'self' addresses
« Reply #4 on: November 11, 2004, 12:03:33 PM »
Hi Mark_s,

I'll give your how-to a go...

Thing is, I could have sworn that SME resolved its own domain automatically? or am I just going Senile?

If I am, then theres not much hope.. I'm only 26!!

I'll let you know how I get on.
...
Nick

"No good deed goes unpunished." :-x...

Offline NickCritten

  • *
  • 245
  • +0/-0
SME6.0.1 - DNS not resolving 'self' addresses
« Reply #5 on: November 11, 2004, 12:28:10 PM »
:-D

Cheers Mark_S,

Worked a treat....
...
Nick

"No good deed goes unpunished." :-x...