I don't know what "how can I do ?" means. What specifically
are you trying to accomplish?
The code that you wrote, when placed inside the OnBeforeRequest method of your FiddlerScript, will change the hostname of any request for the specified hostname to the specified IP address.
The Tools > HOSTS... command in Fiddler works similarly, but also fixes up HTTPS certificates, etc.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.