Reply
New Member
Posts: 13
Registered: ‎11-02-2016

temporary static dns for guests

Hi Unifi community,

 

I have more specific question and I hope someone may can help.

 

I want the IP of a client, that has logged in via Hotspot (Guest Control), to be related to a static dns for a certain hostname for 3 minutes.

 

In fact:

1.) user loggs in

2.) for 3 minutes the hostname login.mydomain.de is affected by the local dns entry and so redirected to i.e. 192.168.1.9
4.) after 3 Minutes the hostname login.mydomain.de is not affected by the local dns entry anymore

Is that possible? Thanks in advance Man Happy

Senior Member
Posts: 2,770
Registered: ‎01-29-2015
Kudos: 449
Solutions: 116

Re: temporary static dns for guests

I can't think of a way to make it that way for only 3 minutes.

New Member
Posts: 13
Registered: ‎11-02-2016

Re: temporary static dns for guests

Hello, thanks for reply. Is there any chance to trigger a script on user login at least?
Veteran Member
Posts: 4,966
Registered: ‎06-13-2015
Kudos: 1344
Solutions: 234

Re: temporary static dns for guests


@eventifi wrote:
Hello, thanks for reply. Is there any chance to trigger a script on user login at least?

@eventifi No idea why you would want that, with HTTPS that will only throw errors.

 

That being said, if you wish to trigger a script when a user logs in you will most probably need to implement a custom external portal. Maybe you can trigger an external script by modifying the AngularJS portal code but I would not advise following that route, though, because that may not survive controller upgrades.

Art of WiFi
Check out our UniFi API browser tool on GitHub. The PHP API client which it uses, can be found here on GitHub.
The thread on our UniFi Device Search tool can be found here, also check out our Captive Portal solutions for UniFi.
New Member
Posts: 13
Registered: ‎11-02-2016

Re: temporary static dns for guests

Thanx @slooffmaster,

I can explain the background:

If you connect to a Wi-Fi hotspot with Android, so opens a CaptivePortal browser. There you will be shown the login page. Logging in, Android will immediately shut down this CP browser radically.

But we want him to stay open to be able to show content after login.

Android calls a specific, unencrypted URL. We want to block this URL via static DNS. But only for 3 minutes from login on per user.

This is why I want to trigger it on authentication event...

Maybe there is a more elegant solution for this Man Happy
Veteran Member
Posts: 4,966
Registered: ‎06-13-2015
Kudos: 1344
Solutions: 234

Re: temporary static dns for guests


@eventifi wrote:
Thanx @slooffmaster,

I can explain the background:

If you connect to a Wi-Fi hotspot with Android, so opens a CaptivePortal browser. There you will be shown the login page. Logging in, Android will immediately shut down this CP browser radically.

But we want him to stay open to be able to show content after login.

Android calls a specific, unencrypted URL. We want to block this URL via static DNS. But only for 3 minutes from login on per user.

This is why I want to trigger it on authentication event...

Maybe there is a more elegant solution for this Man Happy

@eventifi Okay, understood. In that case the best approach is to build a custom external portal so you have full control of the flow and the moment the device is authorized.

Art of WiFi
Check out our UniFi API browser tool on GitHub. The PHP API client which it uses, can be found here on GitHub.
The thread on our UniFi Device Search tool can be found here, also check out our Captive Portal solutions for UniFi.
New Member
Posts: 13
Registered: ‎11-02-2016

Re: temporary static dns for guests

@slooffmaster
We already use an external portal. But the issue I can not solve is, how to set the temporary static DNS rule per user.
Veteran Member
Posts: 4,966
Registered: ‎06-13-2015
Kudos: 1344
Solutions: 234

Re: temporary static dns for guests


@eventifi wrote:
@slooffmaster
We already use an external portal. But the issue I can not solve is, how to set the temporary static DNS rule per user.

@eventifi In that case I believe the portal is not implementing your required flow in the correct manner. IMHO, the only way to open a page for all browsers is to delay the authorization. Besides that, I doubt that temporarily modifying DNS for a single device each time is feasible.

Art of WiFi
Check out our UniFi API browser tool on GitHub. The PHP API client which it uses, can be found here on GitHub.
The thread on our UniFi Device Search tool can be found here, also check out our Captive Portal solutions for UniFi.
New Member
Posts: 13
Registered: ‎11-02-2016

Re: temporary static dns for guests

Thanks @slooffmaster 

Is there any parameter in the unifi API to delay the authorization?

Veteran Member
Posts: 4,966
Registered: ‎06-13-2015
Kudos: 1344
Solutions: 234

Re: temporary static dns for guests


@eventifi wrote:

Thanks @slooffmaster 

Is there any parameter in the unifi API to delay the authorization?


@eventifi I'm afraid not, which is why I recommend you adapt your code to match your flow.

Art of WiFi
Check out our UniFi API browser tool on GitHub. The PHP API client which it uses, can be found here on GitHub.
The thread on our UniFi Device Search tool can be found here, also check out our Captive Portal solutions for UniFi.
Reply