First ensure the second domain (www.urlb.com) has a DNS A record similar to the first domain (www.url.com). This can be verified with the following commands.
nslookup -q=a www.url.com
nslookup -q=a www.urlb.com
They should both output the same IP address.
Next ensure the second domain is "parked" on the first domain. If your hosting provider uses CPanel you will find an option named Parked Domains.
wp-config.php file and add the following lines before the line that says Happy Blogging.
Replace static links
There may be links in articles which point to the previous domain. So use a plugin like Search and Replace to change those.
Check for broken links
After everything is done use a tool like Linkchecker and check for broken links.