At @Renan’s suggestion, I will try to elaborate my answer better, although I am not an expert on DNS :)
But there are two ways (as far as I know) to create subdomains for a given host. Or by records Address or by CNAME.
1. Log in to your DNS provider
There you can create, update, delete DNS records. Remembering that these changes, if memory serves, take a certain amount of time to be applied (up to 48 hours, at @brasofilo’s suggestion) because it does not depend only on your provider, the new registration needs to propagate between the TLD’s higher level and etc...
I believe that when entering your provider, you will see a screen similar to this:
I don’t know how the changes of TTL (Timetolive) influence performance, since when the TTL of a record ends, it is necessary to consult the TLD’s higher level, which can lead to lost time consulting DNS, since the cache of DNS is made based on the TTL.
2. Creating ADDRESS type records (A)
If you know the IP’s servers and they won’t change, so just create a record like To for each with the value:
srvbr.meudominio.com IN A IP.do.Servidor.BR
srveua.meudominio.com IN A IP.do.Servidor.EUA
And wait a certain period for the record to spread.
3. Creating CNAME type records
The records of type CNAME do not accept IP’s, they are aliases ("shortcuts") for domains. That is, if I create a CNAME record of:
srvbr.meudominio.com IN CNAME srvbr.com
srveua.meudominio.com IN CNAME srveua.com
When someone is solving the DNS (browser, whoever), the address srvbr.meudominio.com will point to the srvbr.with.
With this strategy, you need to configure a domain for each server, that is, you need each server to have an Address record pointing to the IP. According to this question of the OS, CNAME does not accept values of type IP.
In the end it would have something like:
srvbr.com IN A xxx.xxx.xxx.xxx
svreua.com IN A yyy.yyy.yyy.yyy
srvbr.dominio.com IN CNAME srvbr.com
srveua.dominio.com IN CNAME srveua.com
Practical example:
I I don’t have hosting for a personal page of mine, but I do have a personal page on Github Pages. What I do: I created a CNAME that points to my domain meudominio.with to the menunome.github.io. Given that I cannot trust the IP (registration type A), which is not under my control.
If I made any theoretical mistake, I’m sorry because I’m not an extreme DNS expert. Feel free to suggest changes
Some suggestions for reading:
- Cname_record
- understanding them-dns-records-aaaa-ns
- Differences-between-a-cname-alias-url
- cname-record
You need to access your DNS provider and create two ADRESS-type records for the respective subdomains and IP servers. Creating CNAME’s also works, but then servers need to have a domain.
– Wakim
@Wakim elaborates more his comment and turns in response.
– Oralista de Sistemas
@Renan, done :)
– Wakim