RecordID for RouterOS

Hello. Please how i can get RecordID?

I have script for RouterOS where i must adding this item.

I’m guessing you are talking about DNS records and you can get the records with an API call docs

Yes, this is DNS. I read the docs but I didn’t find the “record id” item. And I don’t know how to get it.

# Configuration ---------------------------------------------------------------------

:local TOKEN ""
:local ZONEID ""
:local RECORDID ""
:local RECORDNAME ""
:local WANIF ""

#------------------------------------------------------------------------------------

:global IP4NEW
:global IP4CUR

:local url "https://api.cloudflare.com/client/v4/zones/$ZONEID/dns_records/$RECORDID/"

:if ([/interface get $WANIF value-name=running]) do={
# Get the current public IP
    :local requestip [/ip address get [/ip address find interface=$WANIF ] address]
    :set IP4NEW [:pick $requestip 0 [:find $requestip "/"]]
# Check if IP has changed
    :if ($IP4NEW != $IP4CUR) do={
        :log info "CF-DDNS: Public IP changed to $IP4NEW, updating"
        :local cfapi [/tool fetch http-method=put mode=https url=$url check-certificate=no output=user as-value \
            http-header-field="Authorization: Bearer $TOKEN,Content-Type: application/json" \
            http-data="{\"type\":\"A\",\"name\":\"$RECORDNAME\",\"content\":\"$IP4NEW\",\"ttl\":60,\"proxied\":false}"]
        :set IP4CUR $IP4NEW
        :log info "CF-DDNS: Host $RECORDNAME updated with IP $IP4CUR"
    }
} else={
    :log info "CF-DDNS: $WANIF is not currently running, quitting"
}

If you check the docs you will see you need to make a GET request to https://api.cloudflare.com/client/v4/zones/<zone>/dns_records/. This will return all your DNS records and you can find the one you are looking for there will be a record ID in the response.

2 Likes

Thank you for help.

After working with attempts to set up and study the entire documentation, I realized that I could not use the command because …
"message": "You cannot use this API for domains with a .cf, .ga, .gq, .ml, or .tk TLD (top-level domain).

The first version of the command was the correct, I did not know that the use of domain name extensions is limited. Discrimination against people from these countries. Unnecessarily lost 12 hours of my life (Too bad I can’t invoice them). I wrote in support of whether they could allow me a domain so we’ll see.

No. Cloudflare decided to restrict users to use certain API calls for the 5 TLDs mentioned was because they are the TLDs that people can just get for free easily and use them to abuse (correct me if I’m wrong).

3 Likes

Yes, such a possibility is always and with everything, but it is foolish to block it. The fact that someone buys a domain for free is a matter of supply and demand between the seller and the customer, and no third party can force the customer to pay for something if he did not steal the domain (registered as a customer, normally receives an invoice for services, although it is issued at 0 Euro, and agrees to the terms and conditions as other customers). It is up to the seller how price is for the domain and not to other service providers. Having something for a better price than others is called progress and competition. The fact that a third party starts persecuting someone for having a more advantageous service is called discriminatory conduct and unfair competition, and in many countries such conduct is criminal.

Blocking of services takes place on the basis that one is guilty of something and not on the basis that there is a suspicion that one could abuse something. Many people use a free domain simply because they can’t afford a paid domain. This is because they have a personal website and do not want to provide an advertising link (mypage.comany.xy but they want to use mypage.xy) or it is a beginning entrepreneur, student, etc …

It is also possible to abuse a domain that someone pays for. Whether someone will abuse the service is not a question of how much the service costs but a question of the motivation that leads them to abuse the service. Paradoxically, one of the motivations for a person to abuse the service may be that the service is blocked for someone and not for someone, which you can see in the fact that the only states that block someone’s access to Internet services on the Internet are only states. some level of communism and not democracy. Such as China, etc. And this is based on social ties rather than on the real danger of endangering or abusing the service by the end customer or company. With the fact that services and traffic are also monitored in democratic countries and servers, which is more than clear for Cloudflare when it provides proxies and firewalls, so the problems of domain traffic is not problem detecting and then solved immediately. The domain name or price cannot be considered an abuse of the service.

For example, based on what Cloudflare is currently doing, I can shoot people with a certain name, mostly used by terrorists from Muslim countries, and if the police arrested me for murder, they would have to release me on the grounds that people with that name often murder. other people and it is therefore legal for me to kill them without any evidence of their participation in the terrorist group or in the country where the murderers lived. They just have that name.

So on the part of Cloudflare, such behavior is stupid, moreover, when it has the opportunity to solve it differently.

How does Cloudflare deal with people who have a domain with a name other than tk, cf, gg, etc., which they pay for (or have their price agreed with the merchant also for free) and abuse it as well? So do they let those people abuse that domain?
What really decides who can abuse a domain and who can’t … its name?
I think it’s discrimination.

Another discrimination is that the states that provide these domains are their official domain representing that state. People who live in the states commonly use it as a national domain. The people of these states are not at war with other states in any way, nor are they acting in any way to harm anyone on a mass scale. So they can’t be responsible for where they were born or where they live, for not doing anything by being blocked from someone. Have your own corporate and personal pages. It is discriminatory conduct by Cloudflare. There are many people who are discriminated against in this way.
“CF” domain (South Africa): 59.31 million inhabitants.
“GB” domain (Gabon): 2.226 million inhabitants.
“GQ” domain (Equatorial Guinea): 1.403 million inhabitants.
“ML” domain (Mali): 20.25 million inhabitants.
“TK” domain (Tokelau) 1 411 inhabitants.

As a result, 83.16 million people on this planet are automatically blocked by the company or the Cloudflare service by living in a place where they have a national domain as a name that represents such a country at the top level. These states are not threatening other states, they do not wage any wars or cyber attacks such as Russia (.RU domains), etc. They just exist and live where they were born. Some part (nowadays a substantial part of the Internet) want to present themselves in the form of websites, businesses, be seen on the Internet.
If someone wants to turn them into a website and use Cloudflare to do so they can’t. Which is a pretty big part. According to official statistics (source: Usage Statistics and Market Share of Cloudflare, February 2022) it is 80.8% of people.

Why can’t he? Why are all of these countries blocked in advance by Cloudflare and not allowed to run their websites?

I ask Cloudflare to unblock these domains and apply the same methods as it does to non-block domains. Why should you or anyone else mind ???

(sorry for my bad english)

Nope. They just can’t perform automated DNS changes. Absolutely nothing else is blocked.

To answer your question, you can get the Record ID from the Audit Log after you make a manual edit of that record in the Cloudflare dashboard.

4 Likes