Link an ENS domain name with an IP address - ethereum

Is it possible to point an ENS domain to an IP address. Not an IPFS hash or Onion site, just a regular old IP address.
There are many tutorials listing how to point an ENS domain name to an IPFS hash, or use some other centralized service. Unfortunately they don't tell me much else. I'm getting the feeling that the answer is no, you can't do that.

Related

US IP address to my Google Cloud functions located in Asia

My service is calling a 3rd party service (binance api) and there is a geo location description for US IP addresses (they banned all US IPs). My deployment's region set to Tokyo but the 3rd party services still sees that my request is coming from the US. Is there any solution to get a local ip address to functions where it is located?
You can achieve this requirement by creating a static external IP address in the same region.
To achieve this go through this document which shows how to reserve IP address to a cloud function as it is mentioned clearly what you need to get
In some cases, you might want traffic originating from your function to be associated with a static IP address. For example, this is useful if you are calling an external service that only allows requests from explicitly specified IP addresses.
For more information you can go through this Thread

Banning an ip to visit a particular page

I am making a forum for a project. I wish the users to be anonymous to the public but want to store their ip addresses in my database so that I can block them if they pass any derogatory remarks or vulgar content on the forum. Once a user is blacklisted, he/she cannot make a post request to the forum. So they cannot post. What are the possible flaws in this project? And how do I come over this solution. Thanks in advance.
Blocking a user by blocking their IP address is not feasible. IP address that users use will change frequently . Even if they don't change, once you block the IP, they will change the IP immediately.
A better way would always be to have users register and then use the account to post anything. But, of course don't show their name or any details in the post. Don't link the user posting the content to any user profile. Only if they post anything which don't meet your posting guideline, just block the user.
You might also need privacy policies and user policies to provide privacy to users, if you are creating that kind of forum.
How do I block an IP address?
You can add this to your .htaccess
If you don't know what a .htaccess file is, it's a file you put in a folder of your website. It's just called ".htaccess". You can put these files in folders, and they will apply to the files of the folder that they are in, and any sub folders. This will only apply to some servers, so you could ask your web host for more information.
Anyway, pop this into that .htaccess file, and replace "x.x.x.x" with a real IP address:
Order Deny,Allow
Deny from x.x.x.x
Deny from y.y.y.y
Deny from z.z.z.z
# repeat these lines as necessary
How well does it work?
How effective this method actually is is hard to define, because ISPs constantly change IP addresses. This is one reason why hosting a website on a home internet connection can be difficult. Also, if someone's IP address is blocked, they could just use a different internet connection or use a VPN.

Google Geocode API deny the request - NodeJS

I want a geocode a street address in NodeJS, but the the google API deny the request, because of the IP address. I have dedicated IP address on my server, I generated API key used this IP address. My request looks like this:
https.get('https://maps.googleapis.com/maps/api/geocode/json?address=MY_ADDRESS&key=MY_KEY', function(response){...........});
I registered my currently public IP address of my computer just for to try the API and if I send a request from my computer it is working fine.
I found the following instruction on google developer site:"Every API request is generated by software running on a machine that you control. Per-user limits will be enforced using the address found in each request's userIp parameter, (if specified). If the userIp parameter is missing, your machine's IP address will be used instead."
Does it mean that I can add userIp parameter like this?:
https.get('https://maps.googleapis.com/maps/api/geocode/json?address=MY_ADDRESS&key=MY_KEY&userIp=MY_IP', function(response){...........});
I tried this on as well, but still not working. Has anyone an idea what I doing wrong?
Well, I think it takes some time to active the rule after you set that up.
If you are using it to test your app, you can set a server key which allow the ip 0.0.0.0/0, which in other terms, any ip address.
and I do not think you can override the request ip address. thetest you're referring to is about Per-user limits.

GCE external IP not from selected region?

I selected my VM zone to be in asia-east1-b but the static I got from generating is from the US? Does google give a IP from the selected region at all?
It's likely that the service you're using to check the physical location of the IP address is checking the location of the IP's owner, Google, rather than the IP itself. In any case, the location of the IP isn't really important as long as the routes work properly.

New host - 404 Error

I am a newcomer at the web part of programming and I was given a host. I uploaded a simple index.html file with one header(It is correct). If I then try to connect with the nameserver/ip (gotten with PuTTy) , I get an 404 error. I have tried many different stuff about folders , but I could not fix anything
The nameserver IP address is almost certainly not your hosting IP address. The nameserver is the server (probably owned by your host - but possibly an outsourced service) that converts the human readable domain name (such as www.domain.com) to an IP address the computer can connect to (such as 198.252.206.16 - the IP 4 address I get for www.stackoverflow.com). It acts as a giant lookup list of domain names and IP addresses, much like a telephone book or Yellow Pages.
Moreover, as your host will almost certainly be hosting many domains (tens or possibly hundreds) per server, you will need to use a domain name when attempting to connect to your web page - this will be needed for Apache or IIS to know how to route the request/which content to return to the browser. It will do this using the request header sent by the browser when requesting the page. If you are testing locally then localhost/127.0.0.1 will be good enough if you have a single site registered/single set of content in a wwwroot directory (or equivalent). Similarly a virtual server or dedicated server may well respond to requests by IP address if it is the only site/application registered on the server.
To use another real-world analogy, it is a bit like addressing an item of post to a town or village - without including the recipient name, street or house number - and then expecting it to be received and to get a response.
Some hosts provide temporary domain names for you to use before you purchase your domain name or whilst the domain name details are propagated to DNS servers around the world. This usually looks something like-
http://your-user.your-host.com/ or http://server.your-host.com/your-username/
If your host offers such a service then this should normally be detailed in their self-help pages, or the admin area where you set up the site. Clearly such a domain is not intended for "production" use, and you should purchase a domain name before using the site for anything other than testing - if only to allow you the flexibility to move to a new host in the future.
This is not a question for StackOverflow users though, and I strongly suggest you consult your host's documentation or contact them for further assistance.