Is it possible to set a custom URL for captive portal detection in Ubuntu?

Ubuntu uses https://connectivity-check.ubuntu.com by default to check the connection. Is there a way to change this URL, for example to https://your.host.com/another-path?

2 Answers 2


You can set the URL using the uri parameter in the NetworkManager config file /etc/NetworkManager/NetworkManager.conf. Add the following lines there:


The important part is that the server must return either the header X-NetworkManager-Status with a value of online or a body content with NetworkManager is online.

You can also set interval to set the check interval in seconds and response to require a specific string in the check response. For more information see the CONNECTIVITY SECTION of the NetworkManager man page.

After that you have to restart the NetworkManager or reboot your system:

# sudo service network-manager restart

supplementary for the existing answer, for the most recent ubuntu dists, the command for network-manager restart should be

# sudo systemctl restart systemd-networkd

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.