don't understand results of NS setup


I have a box with Centos 5.2 and Virtualmin GPL in a near default configuration. I have added one hosted site, The nameservers are and After a conversation today with my registrar the appropriate records for web pages and email were set to ip address

Before this was done keying that ip into the address line of a browser gave the default page at /var/www/html. Since the change was made the url doesn’t resolve, but the ip address gives the html at /home/choked/public_html.

I don’t understand why this takes place. I’ve copied out the virtualhosts section of httpd.conf below in the hopes that someone with sharper eyes than mine may see a problem. It looks ok to me.



SuexecUserGroup #501 #502
DocumentRoot /home/choked/public_html
ErrorLog /home/choked/logs/error_log
CustomLog /home/choked/logs/access_log combined
ScriptAlias /cgi-bin/ /home/choked/cgi-bin/
ScriptAlias /awstats /home/choked/cgi-bin
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/choked/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
<Directory /home/choked/cgi-bin>
allow from all
Alias /dav /home/choked/public_html
Alias /pipermail /var/lib/mailman/archives/public
<Location /dav>
AuthType Basic
AuthUserFile /home/choked/etc/dav.digest.passwd
Require valid-user
ForceType text/plain
Satisfy All
AuthName " statistics"
AuthType Basic
AuthUserFile /home/choked/.awstats-htpasswd
require valid-user
RedirectMatch /cgi-bin/mailman/([^/])(.)$1.cgi$2
RedirectMatch /mailman/([^/])(.)$1.cgi$2
PerlRequire /etc/webmin/virtualmin-google-analytics/
PerlOutputFilterHandler Virtualmin::GoogleAnalytics
PerlSetVar AnalyticsID root

You’re conflating two different concepts, and it’s confusing you. I know that’s the case, because I read your description, and I look at your configuration file, and I think, “Yes, that’s exactly how things ought to be behaving. I wonder what he believes it ought to be doing instead?” :wink:

So, let’s cover the basics:

DNS takes a little while to propagate. is resolving to for me, which I believe is correct.

Apache has either a “one website” mode, or a “virtual hosting” mode. The two cannot co-exist (if you understand how IP-binding in UNIX works, this becomes an obvious truth…but it’s not wholly intuitive if you don’t have such pre-existing knowledge). So, Apache is either answering requests in a “one website, no matter what” way or in a “best-first match” way. Since you’ve created a VirtualHost, it is now operating in “best-first match”. This means that any request to IP (which I assume is NAT’ed from public IP will run through the list of available VirtualHost entries, and the first one it finds is the “best-first match”. That’s

Working as designed.

So, now, the question remains: What are you trying to accomplish that we can help with? (Since, again, I don’t see a problem in your description.)

Oh, yeah, is bringing up results for me. I’m guessing they are correct. Perhaps DNS just hadn’t propagated when you tried earlier?

You may also be running into a problem very common to consumer level routers: they don’t actually route (the router makers incorrectly call this “loopback” or “reverse routing”). So you can’t go out from the private network, and then back in on a public IP. You’ll always have to hit private addresses from inside the network. But this is yet another orthogonal issue, and easy to conflate with DNS and web server problems. But they’re all independent of one another, and need to be dealt with independently.

$ host is an alias for has address mail is handled by 0

$ host has address mail is handled by 0

Looks good to me as well.
You must have been using old cache.

OK, I am looking at the site from inside the subnet where the server lives, maybe that’s complicating matters. I’ll go off-site and try again. Thanks very much for the responses.


yes it works fine from off-site. thanks for the comments, the facility works just as advertised, very nice.


I think I was not allowing for propagation time, and also may well have one of the routers you describe, it’s a no-name.

Can I raise another issue here or should I start a new thread? I want to get email for this domain under way. I’ve ticked what I think are the appropriate boxes but when I try a test mail I get bounced after a delay. what is the appropriate documentation for email setup and use (user settings, any other pertinent configuration info)?


Can I raise another issue here or should I start a new thread?

New thread. It’s hard enough to keep up with stuff when it’s divided out into nicely titled threads, with one thread per problem. It’s impossible if there are multiple issues in each thread. :wink:

It’s also easier for others to search successfully within the forums.

You’ll want to start with the troubleshooting email guide, which will help you ask good questions about your problem, and provide the log details we need in order to help you:,email_troubleshooting/


if you want to see your site inside the lan environment , you can add it to your hosts file on the machine with the browser (just like the old days)

on a windoze machine it’s in c:\windows\system32\drivers\etc\hosts