Can we use a different subdomain than 'stun'/'turn' for a STUN / TURN Server? - webrtc

All the documentation / tutorials for setting up a STUN / TURN server suggest that we need to create two subdomains namely:
stun.yourdomain.com
turn.yourdomain.com
And then these can be accessed as:
stun:stun.yourdomain.com:5349
turn:turn.yourdomain.com:3478
Is it possible to register subdomains with different names than "stun" and "turn" ?
Has anyone tried / created subdomains as:
stun:somothername.yourdomain.com:5349 ?
Is there any official documentation / reference that can be used to understand this in more detail?
Thanks in advance!

If I understand RFC 5389 correctly, there is no requirement to use specific domain names, on the contrary:
Hard-coding the domain name of the server into software is
NOT RECOMMENDED in case the domain name is lost or needs to change
for legal or other reasons.
(from section 9)
As long as you follow the advice in that section for DNS Discovery, you should be able to use any domain/host name you like.

Related

Display Domain suggestions having keywords appended in suggestions - WHMCS domain checker

I'm working on WHMCS Latest Version 7. On submitting domain checker form, usually we get the domain availability information and domain suggestions with other extensions. For example: If we search for example.com, We will get a set of suggestions as follows.
example.net
example.org
I need another set of suggestions with some set of words appended with the keyword user selected as follows
theexmaple.net
myexample.net
exmapleonline.net
theexmaple.org
myexample.org
exmapleonline.org
Domain suggestions are implemented by Domain Registrar modules. You can use eNom or ResellerClub for their built in suggestions. Both of those will attempt to use related words in the name to get a better suggestion. If you want behavior exactly like you described, you can write a custom domain registrar module that adds the common prefixes and suffixes you're interested in and then returns results.
http://developers.whmcs.com/domain-registrars/availability-checks/

Pass data such as username in hostname

I have seen some sites use hostnames as data such as usernames (for example username.example.com) and was wondering how you would be able to achieve this.
Is it good practice to use hostnames like this or are there reasons against it?
Thanks in advance.
It is generally bad practice to treat hostnames this way. Lookups become a bit more complicated and it is always safest to use usernames in the path or query.
Hostnames are designed to be thought of in a global sense. For instance user.example.com/username/profile
It also helps protect the user (a little) because paths can be encoded into the http request where a subdomain request essentially requests user.example.com and that request can be redirected multiple times before returning to the client and dns monitoring is the number one way that people do tracking.
DNS tracking is easy because its already fast, open, and the contents aren't designed to be hidden like https or more recent ipsec techniques.
I've accomplished this by setting up a DNS wildcard with your DNS host (*.example.com) then using PHP to parse out the username in the URL and act accordingly.

Planning url rewrite for my web app

I'm working on a site which shows different products for different countries. The current url scheme I'm using is "index.php?country=US" for the main page, and "product.php?country=US&id=1234" to show a product from an specific country.
I'm planning now to implement url rewrite to use cleaner urls. The idea would be using each country as subdomain, and product id as a page. Something like this:
us.example.com/1234 -> product.php?country=US&id=1234
I have full control of my dns records and web server, and currently have set a * A record to point to my IP in order to receive *.example.com requests. This seems to work ok.
Now my question is what other things I'd need to take care of. Is it right to assume that just adding a .htaccess would be enough to handle all requests? Do I need to add VirtualHost to each subdomain I use as well? Would anything else be needed or avoided as well?
I'm basically trying to figure out what the simplest and correct way of designing this would be best.
The data you need to process the country is already in the request URL (from the hostname). Moving this to a GET variable introduces additional complications (how do you deal with POSTs).
You don't need seperate vhosts unless the domains have different SSL certs.

static or dynamic ips

I run this site and I approve access for a section of the site for people. I only want to approve static ips. If i have a bunch of IPs how do I find out if they are static or not? I can do the remaining parts but there is probably some function in the socket library or something that lets me script the part to find if the users are using static or dynamic IP.
thanks !
Php/Js would work too.
There is no way to inherently tell if an IP address is static or dynamically assigned. Based on the hostname that the IPs resolve to, you could probably make a guess as to whether they are static or not, but there is nothing definitive to facilitate this.
You could use the socket module to resolve the IPs to hostnames and flag them as "static" or "dynamic" based on some kind of "best guess" algorithm, but it would be only that: a best guess.
Here is an example using a random Verizon FiOS IP address. This assumes that any IP starting with "pool" is dynamically assigned.
>>> hostname = socket.gethostbyaddr('71.243.222.111')[0]
>>> if 'pool' in hostname:
... print hostname, 'is dynamic'
...
pool-71-243-222-111.lsanca.fios.verizon.net is dynamic
You're going to have a very tough time determining all of the various naming conventions and this would in no way be a complete solution.
You might want to ask yourself what kind of problem you're trying to solve first, and whether filtering access by IP address is providing the kind of verification you need.
I'd use a pragmatic solution: New accounts have a trial phase of a few days. After that they can only log in from the same IP used to sign up. If they still have that same IP it's most likely static.
Well, you don't have a problem, do you? If they ask for access from IP X, you give them access from IP X. If it turns out that it was dynamic and they switch, they no longer have access. In practice, no access from dynamic IPs :)
Seriously though, the authority on IP assignment type is the host from which the user is accessing. Thus, you need to ask the user what it says in his/her config.

Proper way to forward domain from Server A to Server B

Here's my situation.
I register myweb.ca (country specific) domain with Webhost Provider A because they allow ccTLD, while Webhost Provider B does not. I host my PHP files on Webhost Provider B at http://mysecretweb.com/myweb/ because I like them better (reliable, cheaper, proven etc...).
I want to achieve the following:
When user types http://myweb.ca/aboutus.html, they will see the contents of http://mysecretweb.com/myweb/aboutus.html
When user visits aboutus.html, the browser must display http://myweb.ca/aboutus.html, NOT http://mysecretweb.com/myweb/aboutus.html
The public and search engines CAN NOT BE AWARE of the domain http://mysecretweb.com/myweb because it is a secret.
Any solution offered must not negatively impact SEO
Will domain forwarding with masking solve my problem? Any suggestions?
Additional Detail
Someone suggested I change nameserver information from ns1.providerA.com to ns1.providerB.com. Someone else counter argued that provider B will prohibit this because provider A is not on the network, and that provider B may ban my account for doing this. I am confused...
You could write one PHP script that gets an URL from $_GET, downloads it and passes to user (including headers) - and then some .htaccess Rewrite magic to point everything to that script. This is about the only way that is entirely transparent to both humans and bots.
you could try and detect bots and humans apart and have diferent actions for the 2