How do I run a virtualmin server inside a LAN only?

OK, I’ve just got hold of a Dell PowerEdge T710 with 2x Intel Xeon 6 core CPU’s, 192GB RAM, and 8x 1TB SAS HD’s configured as raid 5, and I installed the bare bones, headless Ubuntu Server 18.04.2 LTS, then I set the server hostname to a FQDN, then installed virtualmin using the install script, and let it install everything needed.

Now the question is, how can I use virtualmin to create LAN only access virtual servers? When I created a virtual server via the virtualmin ‘Add virtual server’ page, the DNS records are pointing to my WAN IP not the servers LAN IP.

This is what I did to setup my workstation to try and access any virtual servers on the server:-

1st I opened the NIC properties on my windows workstation and set the IPV4 DNS client IP address to the virtualmin server )

2nd Disabled LMHosts search.

3rd using a command window to flush the DNS resolver cache, ‘ipconfig /FLUSHDNS’

4th disable the NIC, then re-enable it

So now hopefully, any DNS requests should go through bind9 DNS service on the virtualmin server right? Wrong!, when I do a tracert on an outside domain name, such as, the first hop should be my server, but it’s isn’t,

Oh and the virtualmin server’s network DNS client settings are set to resolve file then DNS, and also the DNS order is:-

Here’s and example of what I tried:-

1…Create virtual server…domain name =
2…Description = Pchelp website
3…Set admin password

Clicked on Create Virtual Server, then waited for everything to be configured and show the buttons for virtual servers list and show virtual server details. Then on my workstation, I try to use in the address bar and it sends me to actual sites that exist with that domain name, instead of directing it to the internal IP address, but if I directly use I get ‘Access Denied’, which tells me I haven’t yet setup a website there.

So, there has to be a way for virtualmin to use any domain name internally, and not access any outside DNS service unless I actually want to update the OS etc etc.

I should be able to type in a domain name on my workstation and it opens any websites that is configured with that name, EG, would open a website configured on that domain, or if I enter,, then that too opens a website configured for that domain but ONLY on the virtualmin server, I should be able to have 10 or more sites on a shared IP, but accessed using domain names, without attempting to resolve to a real domain name.

There is more than one way to approach this issue.

One way would be, to setup your virtualmin server also as a DNS (and maybe also DHCP) server for your local LAN and that way resolve your desired sites to resolve to local IPs instead of public?
One other way would be, to add those DNS records for local resolve to your DHCP server.
Ugly solution: distribute hosts file to machines needed to resolve those domains as local file to be replaced.

Can you copy and paste nslookup from your server an workstation for the testing domains u’re trying to make it work?

In virtualmin, when you created the server, which IP did you assign it?

That is what you have in /etc/resolv.conf?

Because I believe that’s your issue, as I have this in my resolv.conf:

sudo cat /etc/resolv.conf

Generated by NetworkManager


I changed the domain name to for example purposes.

Before I installed virtualmin, I set the server’s IP to static:-


Then when I installed virtualmin, it set the DNS client to:-

Any virtual server created will use the shared IP of

I pointed my windows workstation’s DNS to the servers IP as bind9 is running on the server, it used to show:-

I changed it to use for the DNS service.

OK, an ‘nslookup’ from a command promt on my workstation showed:-

Server: UnKnown


Non-authoritative answer:



But if I typed in a browser on my workstation I get an actual public website, not the one on the server, plus the DNS records for that domain name on the server show my public IP not the server IP.

And the DNS record list shows 8 addresses for that domain name, and all but point to my WAN IP. points to

This is what I have in /etc/resolv.conf





Added by Virtualmin.

Added by Virtualmin.

From what I understand, if you don’t have local DNS records on your webmin/virtualmin for the domain you want to serve locally, the resolver will use, fail to resolve and proceed with and to resolve the request and resolve it with a public IP and that’s your issue.

Try commenting out the and lines, add DNS records for the domains you want to resolve locally (as per your example) and see how it goes, don’t forget to restart BIND after commenting out the lines.

Shouldn’t virtualmin create those records for you when creating a virtual server?

I have just created a new virtual server using virtualmin, called and the bind DNS records for that domain show all the records needed such as www, ftp, mail, etc etc as well as the domain name itself all pointing to my WAN IP not the server’s internal LAN IP.

EG A record = WAN IP A record = WAN IP A record = WAN IP

etc etc

for some reason when I create new virtual servers using any made up domain name, the DNS records created in bind always show my WAN IP not the servers LAN IP.

What I want to happen is when I create a virtual server using virtualmin, and use that domain name in a browser on my workstation, it should show the default webpage for the newly created virtual server,

When you created the virtualmin server from your example, what did you put under IP address and forwarding:

IP address and forwarding
Default mail forwarding address None
Network interface
Shared, on IP
Virtual with IP
Already active
IPv6 network interface
Shared, on IP
Virtual with IP
Already active
External IP address Same as real address

Network Interface shared on IP

IPV6 disabled

External IP address

Can you copy & paste nslookup command from your workstation and server for the desired domain?

nslookup on server:-






nslook up from workstation:-


Server: UnKnown


Non-authoritative answer:



This is my workstation ipconfig /all details for the NIC:-

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :

Description . . . . . . . . . . . : Realtek PCIe GBE Family Controller

Physical Address. . . . . . . . . : 4C-72-B9-08-0C-28

DHCP Enabled. . . . . . . . . . . : No

Autoconfiguration Enabled . . . . : Yes

IPv4 Address. . . . . . . . . . . :

Subnet Mask . . . . . . . . . . . :

Default Gateway . . . . . . . . . :

DNS Servers . . . . . . . . . . . :

NetBIOS over Tcpip. . . . . . . . : Enabled

That’s your issue, it’s resolving wrong, on your, when used as DNS server for your local net.
Check BIND settings and(!) zone for

Here’s a few screenshots I just took, showing first the domain name in the list of zones, then master zone for that domain, then finally the list of records used on that domain, as you can see the address do point to, but for some reason I can’t use that domain name in a browser on my workstation.

Can you jus for test purposes change /etc/resolv.conf



and redo the nslookup on server and workstation.

cat /etc/resolv.conf


Added by Virtualmin.

Added by Virtualmin.

Exactly the same results as before with nslookup on both workstation and server.
even when I flush the workstation DNS resolver cache using ‘ipconfig /flushdns’, I still get the same results.

I don’t know if this has anything to do with it, but the resolution order on the server is set to local hostname then DNS.

long shot: clear arp cache on workstation:

arp cache flushdns

try nslookup again

nope same result, it seems bind9 is getting results from outside the LAN somehow, because I get an un-authoritative answer with a WAN ip that’s not mine.

Under webmin, Networking, Network Configuration, what are your settings?

Hostname, Resolution order, DNS servers, Search Domains?

Another idea, for testing purposes:
in Webmin, Servers, BIND DNS Server, Miscellaneous Options, set Do full recursive lookups for clients? to NO.
Save, Apply, restart Bind.

Do a nslookup from workstation.

no different.

As for the network configuration:-

Hostname =

Update host name in host address if changed = checked

Resolution order:- localhost name, DNS

DNS Servers:-

Search Domains = None