Forward and mask a WordPress website

There are two aspects to site’s URL in WP (baseline case, multisite aside):

  1. Which URL it considers “real”, responds to, and uses to generate links.
  2. URLs previously generated and persistently stored in content.

Former is pretty malleable and as you discovered already is simply a matter of configuration. More so it’s technically easy (and practically useful in some cases) to have URL configured on the fly, depending on incoming request. Note that you shouldn’t have multiple domains pointing to same site/content in productionm it will likely be penalized by search engines as duplicate content.

If you want to migrate site to different URL (and got your server responding at it) the complete list would be:

  1. Changing URL configuration (what you had done already).
  2. Updating URLs in content (which is typically done with database search/replace tool, note it should be serialize-aware one to be used reliably with WP).
  3. Redirect old URLs to new ones (commonly done at web server level with .htaccess or otherwise).

Also see Changing The Site URL in Codex.