func (u *DnsUpdater) updateDNSServer(nameToRegister, ip, dnsServer, dnsKey string, ttl int) (err error) {

	var tmpFile system.File
	if tmpFile, err = u.fs.TempFile("dnsUpdater-"); err != nil {
		return
	}
	defer u.fs.RemoveAll(tmpFile.Name())

	idx := strings.Index(nameToRegister, ".")
	zone := nameToRegister[idx+1:]

	configBody := fmt.Sprintf(
		dnsConfigTemplate,
		dnsServer,
		zone,
		nameToRegister,
		nameToRegister,
		ttl,
		ip,
	)

	if err = u.fs.WriteFileString(tmpFile.Name(), configBody); err != nil {
		return
	}

	_, _, _, err = u.cmdRunner.RunCommand("nsupdate", "-t", "4", "-y", dnsKey, "-v", tmpFile.Name())

	return
}
		fs      *fakeboshsys.FakeFileSystem
		logFile boshsys.File
	)

	BeforeEach(func() {
		fs = fakeboshsys.NewFakeFileSystem()
		var err error
		logFile, err = fs.TempFile("file-logger-test")
		Expect(err).ToNot(HaveOccurred())
		err = logFile.Close()
		Expect(err).ToNot(HaveOccurred())
	})

	AfterEach(func() {
		logFile.Close()
		fs.RemoveAll(logFile.Name())
	})

	It("logs the formatted DEBUG message to the file", func() {
		logger, logFile, err := New(boshlog.LevelDebug, logFile.Name(), DefaultLogFileMode, fs)
		Expect(err).ToNot(HaveOccurred())

		logger.Debug("TAG", "some %s info to log", "awesome")

		contents, err := fs.ReadFileString(logFile.Name())
		Expect(err).ToNot(HaveOccurred())

		expectedContent := expectedLogFormat("TAG", "DEBUG - some awesome info to log")
		Expect(contents).To(MatchRegexp(expectedContent))
	})