You can insert this template into an already existing note. Just place the cursor where you want the code to appear and press a hotkey you defined before for that specific template.
The downside, of course, is that you have to do that manually whenever you change the ip address in your frontmatter - the content of the code block won’t be adjusted automatically as would be the case with a dataview query. However, this is the only option I can see so far. As I said, you can’t render anything in a codeblock by their very nature.