0

The format for a TXT record is:

owner TTL class TXT text_string

The documentation for dnscmd.exe gives the following syntax for the \recordadd command:

dnscmd [<ServerName>] /recordadd <ZoneName> <NodeName> <RRType> <RRData>

for /recorddelete it is almost identical with the optional [/f] flag

dnscmd <ServerName> /recorddelete <ZoneName> <NodeName> <RRType> <RRData>[/f]

For RRType TXT RRData has the following syntax.

<string> [<string>]

I cannot find an explanation or clear examples of usage

How do these two parameters map to the text_string in the TXT record?

1 Answer 1

1

As the usage text for the TXT <RRType> suggests:

    TXT             <String> [<String>]

The valid input data for <RRData> is one or more strings. If you input several strings, dnscmd will add a single record with a comma-seperated list of the strings you put in as it's value.

So

dnscmd /recordadd contoso.com. mytxt TXT this is the value

will result in the following TXT record:

mytext.contoso.com.  [TTL]  IN  TXT  "this, is, the, value"

If you need to input a string with spaces as a single string value, just enclose it with "":

dnscmd /recordadd contoso.com. mytxt TXT "this is the value"

which will result in:

mytext.contoso.com.  [TTL]  IN  TXT  "this is the value"
3
  • Much thanks. Just to be clear I am not misunderstanding. Are you saying the usage text suggests a single record with a comma separated list, or just that the valid input data is one or more strings?
    – Mr.Mindor
    Nov 20, 2013 at 18:25
  • 1
    The usage text just suggests that multiple strings is considered valid input data (which it is, although the result is not that intuitive) Nov 20, 2013 at 18:45
  • @Mr.Mindor If the answer provided the details you needed, please accept the answer as a solution so it doesn't figure as "unanswered" :-) Nov 26, 2013 at 16:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .