Can Ckeditor use relative paths for images?
You should always use relative paths in your content to avoid the problem you now have.

If it was me I would fix the links in the database so they are all relative. You can do so with sql queries like this:

UPDATE field_body_data
SET body_value = REPLACE(body_value, 'http://example.com/', '/')
WHERE body_value LIKE '%http://example.com/%';


Followed by:

UPDATE field_body_data
SET body_value = REPLACE(body_value, 'http://example.com', '/')
WHERE body_value LIKE '%http://example.com%';


There are two to catch the case you might have a path to the home page without a trailing slash.

You would have to do this for any text area field that might contain a hyperlink.

The Pathologic module will also help you around this issue.
You add the pathologic input filter for your relevant formats, then configure it with your old domain name.
Also add the domain name /
This will make it change relative paths to use their alias, like /node/10 to be /node-path-alias

That last feature with the aliases is very useful.

See https://drupal.org/node/257026 for more info on configuring pathologic.