All undefined means both of your thoughts.
For example, you have the following IPs on the server
You have the following sites on the serverwww.site1.com
= all undefinedwww.site4.com
(yes, as long as you use domain headers you can assign more than 1 site per IP)
In the above scenario, if you enter:
127.0.0.1 or localhost or 22.214.171.124 or ww3.site1.com (as long as there is a DNS going to your server), they will all end up on www.site3.com
because they are defined in your headers and IPs
The server looks at both the IP and the header assigned it it ... if there are no exact matches, it will go to the site marked as "all undefined".
By default, it looks at the IP if no header is defined. If there IS a header defined, and you want the IP to also work (i.e. 126.96.36.199 and www.site1.com
to both go to site 1) then you have to add the IP address to the header as well .... otherwise the IP will also end up at the undefined site.
In Summary, if there is no exact match in the headers for the site, then it goes to the default site as a catchall.