DNS questions

Hi,

I have has a search through teh forums & docs but couldn’t quite find out where I’m going wrong.

I have successfully set up Virtualmin/Webmin on a server that presents itself to the internet. All works fine.

I wanted to set up a servers on my LAN with no external access, so I set up my PCs DNS to point at the IP of the internal server with a secondary DNS of googles 8.8.8.8.

I though I had it all working correctly, in that if I set up a domain on my internal server (e.g. www.google.com ) my browser would pick up the internal server’s DNS and direct me to my ‘test’ site.

But then some how I broke it, and I don’t know how. I did have to change the IP address of the server (so it was static within the LAN).

I just get directed to external sites.

I though perhaps it was due to the nameserver, so I tried to set them to the host name, but I had named the host NOT as fqd but just a s a string of character (eg server01 ) Now what is really strange is I cchange the hostname to server01.com yet if I ping or access server01 from my browser I get to the server, but server01.com is unreachable. I am confused - I have rebooted the server , rebouted my router flushed my dns emptied my cahse but some how the original hostname still exists (but not in /etc/hostname )

What can I do to work out where I have mucked up?

Hi,

If you want a domain like “google.com” to resolve to an internal page without accidentally resolving to an external site, while DNS is an option, the more light weight and simpler option is make use of the “hosts” file.

You can add an entry to the “hosts” which is generally checked before DNS (unless configured differently on your system). This will save you a DNS lookup, and is faster.

10.0.0.10 google.com www.google.com

*** the above line would resolve both “google.com” and “www.google.com” to the local IP address of “10.0.0.10” instead of looking up the domains via DNS. ***

The “hosts” file can be found on most linux systems in the:

/etc/hosts

Let us know if there is anything else required, and/or if this works.

Best Regards, Peter Knowles TPN Solutions

E: pknowles@tpnsolutions.com
P: 604-782-9342
W: http://www.tpnsolutions.com

Thanks, i was trying to achieve it without resorting to the local host (on the PC) But I will try the servers host file see if that creates a viable solution.

By the way, I think the strange behavious of the change of host name being held onto was due to Samba. Even though I rebooted the whole box, when I shut Samba down the old host disappeared.

got it sorted by putting the name server into the local clients’s hosts

Hi,

That’d certainly work too :slight_smile:

Best Regards, Peter Knowles TPN Solutions

E: pknowles@tpnsolutions.com
P: 604-782-9342
W: http://www.tpnsolutions.com