Pardon intrusion ... think Visvanath might have taken a deserved holiday, so as not to delay you and think he would agree ...
IF you do get the variable to adjust to the new IP address, there is one side affect of that ... all previous links to documents/images, etc. in content that has already been created gets broken. Moodle uses that variable to build full url links to content files AND records that IP address in the database tables that link to content. So, a link that had pointed to say http://192.168.1.20/blah ... won't get automagically updated to http://new192.168.x.x IP. Not without having to use the search and replace admin utility to replace all the now errant references in the DB.
If one uses a FQDN that can be resolved in DNS then makes no difference if the IP address of the server changes ... the name stays the same - thus all previously developed content needing a full URL still continue to work.
'spirit of sharing', Ken