Thank you Bill, yes I am supplying the port number. But thank you.
Actually I spoke to the QlikView support desk, and the issue turned out to be very simple. It appears that you cannot change the URL if the QDS windows service is not running. I had stopped the old service because I wanted to move it onto another machine.
So to solve this:
On the machine with the incorrectURL, make sure the QDS windows service is running.
Change the URL.
Stop the QDS service on the machine in incorrectURL.