# Automatically update a Linux firewall (ufw) with DNS look up results

**URL:** <https://discourse.nodered.org/t/automatically-update-a-linux-firewall-ufw-with-dns-look-up-results/22955>\
**Category:** General\
**Created:** [11 March 2020 07:31 UTC](https://discourse.nodered.org/t/automatically-update-a-linux-firewall-ufw-with-dns-look-up-results/22955 "2020-03-11T07:31:11Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![nodecentral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodecentral/32/10432_2.png) [@nodecentral](https://discourse.nodered.org/u/nodecentral)\
**Post date:** [17 March 2020 15:09 UTC](https://discourse.nodered.org/t/automatically-update-a-linux-firewall-ufw-with-dns-look-up-results/22955/21 "2020-03-17T15:09:00Z")

</div>

At last access to a PC !

For those that are able to test it, I'd be interested to hear what you see to be the cause of the difference, it looks to me to be a space is added between the command in the exec node and the payload. (and i can't remove it)

```auto
[{"id":"ffdd1306.1f1d8","type":"dns","z":"d223a8f0.30c528","name":"Lookup IP","method":"lookup","x":610,"y":700,"wires":[["9f70e27.23feba","17c6c980.56fb07","16345658.7a4ed2"]]},{"id":"9f70e27.23feba","type":"debug","z":"d223a8f0.30c528","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":810,"y":640,"wires":[]},{"id":"17c6c980.56fb07","type":"template","z":"d223a8f0.30c528","name":"curl https://ipvigilante.com/{{payload}}","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"curl https://ipvigilante.com/{{payload}}","output":"str","x":670,"y":780,"wires":[["178e0c6c.b5050c"]]},{"id":"16345658.7a4ed2","type":"exec","z":"d223a8f0.30c528","command":"curl https://ipvigilante.com/","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":860,"y":700,"wires":[["c29ecee8.21451"],[],[]]},{"id":"c29ecee8.21451","type":"debug","z":"d223a8f0.30c528","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1090,"y":700,"wires":[]},{"id":"810e8feb.0b8018","type":"debug","z":"d223a8f0.30c528","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1090,"y":780,"wires":[]},{"id":"178e0c6c.b5050c","type":"exec","z":"d223a8f0.30c528","command":"","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":930,"y":780,"wires":[["810e8feb.0b8018"],[],[]]},{"id":"9fcbe2f1.cef7d8","type":"inject","z":"d223a8f0.30c528","name":"google.com","topic":"","payload":"google.com","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":450,"y":700,"wires":[["ffdd1306.1f1d8"]]}]

```

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [17 March 2020 15:51 UTC](https://discourse.nodered.org/t/automatically-update-a-linux-firewall-ufw-with-dns-look-up-results/22955/22 "2020-03-17T15:51:05Z")

</div>

you are correct.

---

<div class="post-metadata">

**Author:** ![nodecentral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodecentral/32/10432_2.png) [@nodecentral](https://discourse.nodered.org/u/nodecentral)\
**Post date:** [17 March 2020 20:21 UTC](https://discourse.nodered.org/t/automatically-update-a-linux-firewall-ufw-with-dns-look-up-results/22955/23 "2020-03-17T20:21:14Z")

</div>

Thanks dceejay

🙂 so is that expected then ?

Are you not able to pass command line entries via an inject node ?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [17 March 2020 21:22 UTC](https://discourse.nodered.org/t/automatically-update-a-linux-firewall-ufw-with-dns-look-up-results/22955/24 "2020-03-17T21:22:19Z")

</div>

Yes it expected - the parameters for a command are appended using a space to separate them. If you want them as one parameter you need to concatenate them yourself as you have done with the template (or using a function node).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [16 May 2020 21:22 UTC](https://discourse.nodered.org/t/automatically-update-a-linux-firewall-ufw-with-dns-look-up-results/22955/25 "2020-05-16T21:22:24Z")

</div>

Closed on 16 May 2020 21:22 UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/automatically-update-a-linux-firewall-ufw-with-dns-look-up-results/22955.md?page=1)
