Site is redirecting to old domain on button submission, files are linking to old domain
Yes, you have to edit it to dev.example.com. In the Drupal code, the modules use a function who returns the base URL. So if this URL is the old site... it resolves to the old site. 

It's also used to protect your website against XSS.