Update host file on deployment

Hi Everyone -  is there a way wherein we can update hosts file before or after we deploy a worker or web role on a cloud service?

I need to add a DNS record with directly accessing or remoting the cloud service vm instace.

Thanks

John

February 11th, 2015 7:44am

Managed to resolved this by doing it programatically.

using (StreamWriter w = File.AppendText(
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System),
                "drivers/etc/hosts")))
            {
                w.WriteLine("SOMEIP NAME");
            }

Thanks

  • Marked as answer by John Genaro 22 hours 50 minutes ago
Free Windows Admin Tool Kit Click here and download it now
February 11th, 2015 7:51am

Managed to resolved this by doing it programatically.

using (StreamWriter w = File.AppendText(
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System),
                "drivers/etc/hosts")))
            {
                w.WriteLine("SOMEIP NAME");
            }

Thanks

  • Marked as answer by John Genaro Wednesday, February 11, 2015 12:50 PM
February 11th, 2015 3:49pm

Managed to resolved this by doing it programatically.

using (StreamWriter w = File.AppendText(
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System),
                "drivers/etc/hosts")))
            {
                w.WriteLine("SOMEIP NAME");
            }

Thanks

  • Marked as answer by John Genaro Wednesday, February 11, 2015 12:50 PM
Free Windows Admin Tool Kit Click here and download it now
February 11th, 2015 3:49pm

Hi,

Thanks for sharing your solution, it is beneficial to others who encounter the similar issue, if you have any difficulty in future, welcome to our forum.

Best Regards,

Jambor

February 11th, 2015 8:24pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics