Syntax for the CLI command: DNS
Last adaption: 09.2025
New:
- Layoutanpassungen
This article refers to a Beta version
| Command | Parameters | Description | Example |
|---|---|---|---|
dns getdns get |
Displays all configured zones | dns get | |
dns zonedns zone newdns zone new |
Creating a new DNS zone | dns zone new zone_name "test.local" relay 192.168.175.2 | |
| zone_name | Name of the zone | ||
| relay | Relay IP-Address | ||
dns zone setdns zone set |
Editing a new DNS zone | dns zone set zone_id "2" relay 192.168.175.3 | |
| zone_id | Id of the zone | ||
| relay | Relay IP-Address | ||
dns zone deletedns zone delete |
Deleting a DNS zone | dns zone delete zone_id 2 | |
| zone_id | Id of the zone | ||
dns recorddns record newdns record new |
Creating an entry for a zone | dns record new zone_id "2" type "A" record_name "host2" value 192.168.175.10 | |
| zone_id | Id of the zone | ||
| type | Type of the entry | ||
| record_name | Name of the entry | ||
| value | Value of the entry | ||
dns record setdns record set |
Editing an entry for a zone | dns record set record_id "5" value 192.168.175.11 | |
| record_id | ID of the entry | ||
| value | Value of the entry | ||
dns record deletedns record delete |
Deleting an entry in a zone | dns record delete record_id 5 | |
| record_id | ID of the entry |
To edit or delete an entry, you need the record_id or zone_id. You can find this in the output of dns get:
firewall.foo.local> dns get
zone_id|zone_name |serial |refresh|retry|expire |minimum|relay |record_id|record_name|type|value |priority
-------+-----------------+----------+-------+-----+-------+-------+------------+---------+-----------+----+----------------+--------
4 |test.local |2012122800|10000 |1800 |3600000|3600 | |3 | |NS |host.test.local.|0
| | | | | | | |4 |host |A |192.168.19.1 |0
| | | | | | | |5 |host2 |A |192.168.175.11 |4294967295


