How do I configure the default virtual host return a 404 header in apache?

Did you try:

Redirect 404 /
ErrorDocument 404 "Page Not Found"

in the default VirtualHost?


Here is example of 000-default.conf that will return 404 error if server name is not configured for Apache

<VirtualHost *:80>
  ServerName default
  Redirect 404 /
</VirtualHost>
<VirtualHost _default_:80>
  Redirect 404 /
</VirtualHost>