You can use asterisk to match all hosts or subdomains. The configuration above will use

User foo for myDomain.com

User bar for all subdomains under myAnotherDomain.com

User foobar for any host that doesn’t match with above.

Note for Windows Users

If you are using PuTTY, maybe it’s time for you to switch to GNU tools. MinGW or Cygwin is a great start for that.

However, that GNU tools come with their own home directory. So, if you are using MinGW Shell, then your home directory is may not be your Windows home directory. Type printenv | grep HOME and it will show your POSIX home directory. So, if you are using MinGW shell for ssh, you should create that config under that directory. Otherwise, your good old Windows Home %USERPROFILE%