AdonisJS v6 is here. Learn more in our release blog post.

ip

Validates the value to be a valid IP address. Optionally, you can also enforce the IP version as 4 or 6.

import { schema, rules } from '@ioc:Adonis/Core/Validator'
{
ip: schema.string([
rules.ip()
])
}
{
ip: schema.string([
rules.ip({ version: 6 })
])
}