# validate_url

> **Function** in `langchain_core`

📖 [View in docs](https://reference.langchain.com/python/langchain-core/_security/_policy/validate_url)

Validate a URL against the SSRF policy, including DNS resolution.

This is the primary entry-point for async code paths. It delegates
scheme/hostname/allowed-hosts checks to `validate_url_sync`, then
resolves DNS and validates every resolved IP.

## Signature

```python
validate_url(
    url: str,
    policy: SSRFPolicy = SSRFPolicy(),
) -> None
```

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/85a5a04210452aec2eb3a06a02961c8fefd5c8b6/libs/core/langchain_core/_security/_policy.py#L238)