Problem fixed. I have patched Virtualmin to ignore the IP when namebased is used and inserted in all effected areas $in{'ip'} = "*";
Now namebased works for me for domains and subdomain.. eg below. (note: a space is added to the front of each tag due to this forums html restrictions..)
< VirtualHost *:80>
SuexecUserGroup "#503" "#502"
ServerName blah.com
ServerAlias
www.blah.com DocumentRoot /var/www/vhosts/blah.com/httpdocs
ErrorLog /var/www/vhosts/blah.com/logs/error_log
CustomLog /var/www/vhosts/blah.com/logs/access_log common
ScriptAlias /cgi-bin/ /var/www/vhosts/blah.com/cgi-bin/
[ Directory /var/www/vhosts/blah.com/httpdocs>
Options Indexes IncludesNOEXEC ExecCGI FollowSymLinks
allow from all
[ IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_flag magic_quotes_gpc off
php_admin_flag safe_mode off
php_admin_value open_basedir "/home/webmail:/tmp:/usr/share/pear:/usr/sbin"
php_admin_value include_path "/usr/share/pear:."
[ /IfModule>
[ /Directory>
< /VirtualHost>