Skip to main content

dns_get_forward_allowlist

Function dns_get_forward_allowlist 

Source
pub fn dns_get_forward_allowlist(
    dns_port: State<'_, DnsPort>,
) -> Result<ForwardAllowList, String>
Expand description

Gets the forward allowlist for external domains.

Returns the list of external domains that the DNS server is allowed to forward queries to. This is a security feature. This command is useful for:

  • Viewing allowed external domains
  • Debugging forward issues
  • Security auditing

§Parameters

  • dns_port: Tauri managed state containing the DNS port number

§Returns

Result<ForwardAllowList, String> with forward allowlist or an error message

§Errors

Returns an error if DNS server is not running.

§Example (JavaScript)

import { invoke } from '@tauri-apps/api/tauri';

const allowlist = await invoke('dns_get_forward_allowlist');
console.log('Allowed domains:', allowlist.domains.join(', '));