Please see the following MOS-Note:
You will also need to check:
Preparing For Changing the IP Address, Hostname or Domain Of Oracle Database Servers (Doc ID 363609.1)
If you are using DNS for resolving hostname.
Actual steps are already shared by Markus !!
In additional to document provided by other you can also refer to below mentioned link,It is with respect to 12C but you can follow this steps for Oracle 18C: