Your solution isn't the correct method to 'fix' this problem. You should have set the correct domain name when you were asked to change it during the initial install. What you should do is rename the domain to set the correct domain name, search the forums for details on how to do this or read the wiki article on the subject.
BTW, you might want to see the following
bug report on why your 'solution' won't work long term.