简体   繁体   English

如何将本地 IP 地址链接到本地网络中的域名,以便使用该域名的任何设备都可以访问网站?

[英]how to link local IP Address to a domain name in local network, so website can be accessible to any device using the domain name?

I am a NOOB to programming and networking so please forgive me for any mistakes.我是编程和网络的菜鸟,所以请原谅我的任何错误。

I have searched on stack,google for my problem but the solutions i found didn't went well with me and so please do consider answering my question even if you consider it is simple or duplicate question.我已经在堆栈、谷歌上搜索了我的问题,但我发现的解决方案对我来说并不顺利,所以即使你认为它是简单或重复的问题,也考虑回答我的问题。

My Problem - I have a nodeJS server built using express and it can be accessed on address http://192.168.209.239:8001/ now i want to access server using domain names like normal website say i want to access the server using http://myserver.app/我的问题- 我有一个使用express构建的nodeJS服务器,可以在地址http://192.168.209.239:8001/上访问它现在我想像普通网站一样使用域名访问服务器说我想使用http://myserver.app/

found Solutions - i found about DNS but i was not able to set it up, then i found that editing the etc/host file can solve this but domain name was only working on my laptop where the app is running, if i connect my phone to same network * and when i type the domain name it does not work.找到解决方案- 我发现了DNS但我无法设置它,然后我发现编辑etc/host文件可以解决这个问题,但如果我连接手机,域名只能在运行应用程序的笔记本电脑上运行到同一个网络*,当我输入域名时它不起作用

I found about mDNS .我发现了mDNS but i was a very old post which told we can use Apple Bonjour but it is not working as i learned that Microsoft has done some implementation of mDNS so make Bonjour work disable mDNS in registry and i am not willing to do that.但我是一篇非常古老的帖子,它告诉我们可以使用Apple Bonjour ,但它不起作用,因为我了解到微软已经完成了一些mDNS的实现,所以让 Bonjour 工作在注册表中禁用 mDNS,我不愿意这样做。

What i ask - please give me step by step guide how to stepup DNS or mDNS on my machine so if any device connects to my network it can access the NodeJS app thought its browser using domain URL http://myserver.app/我要问什么-请逐步指导我如何在我的机器上升级 DNS 或 mDNS,这样如果任何设备连接到我的网络,它就可以访问 NodeJS 应用程序,认为它的浏览器使用域 URL http://myserver.app/

I am using nodeJS@16.13.2 , express@4.17.2 , Windows 11 version 21H2 build 22000.376我正在使用nodeJS@16.13.2express@4.17.2Windows 11 version 21H2 build 22000.376

My Network is like I have connected my mobile hotspot to laptop and any new device to connected to hotspot so may my mobile is kind of a wifi router.我的网络就像我已经将我的移动热点连接到笔记本电脑以及任何连接到热点的新设备,所以我的手机可能是一种 wifi 路由器。

if a different laptop connects to my hotspot i should be able to access the website using the domain name.如果另一台笔记本电脑连接到我的热点,我应该能够使用该域名访问该网站。 myserver.app

My Phone is using Android 11 and please do consider I do not want to use any online DNS providers like easyDns or AWS i want a local solution which i can run on my laptop我的手机正在使用Android 11 ,请考虑我不想使用任何在线 DNS 提供商,如 easyDns 或 AWS 我想要一个可以在我的笔记本电脑上运行的本地解决方案

  1. Ideally you need to DNS server for this: but its wont work with dynamic IP as your machine ip can change after reboot理想情况下,您需要为此使用 DNS 服务器:但它不能与动态 IP 一起使用,因为您的机器 ip 可以在重启后更改
  2. You can add domain as host entry on each machine: this will not work with mobile and also need to change ip as your machine / server ip change您可以在每台机器上添加域作为主机条目:这不适用于移动设备,还需要更改 ip 作为您的机器/服务器 ip 更改
  3. If you have static ip, just go for any dns service provider easydns, aws and as its inetrnall ip will work for all devices which are in network If you have static ip, just go for any dns service provider easydns, aws and as its inetrnall ip will work for all devices which are in network
  4. Found This may work for y https://www.noip.com/support/knowledgebase/how-to-configure-ddns-in-router/发现这可能适用于 y https://www.noip.com/support/knowledgebase/how-to-configure-ddns-in-router/

Starting with Android 9 Pie it is possible to change DNS globally, provided they support TLS.从 Android 9 Pie 开始,可以全局更改 DNS,只要它们支持 TLS。 Just go in只需 go 在

Settings → Network & internet → Advanced → Private DNS设置 → 网络和互联网 → 高级 → 私有 DNS

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过域名而不是IP地址通过本地网络连接到数据库时,会产生大量开销吗? - Is there a substantial overhead when connect to a database by the domain name instead of the IP Address, over a local network? 缓存域名的IP地址 - Caching IP Address for a Domain Name 如何使用服务器域名从本地计算机访问我的nodejs Web服务器? - How can I access my nodejs web server from my local computer using the server domain name? 无法将域名链接到 IP(不显示任何内容) - Can't link domain name to IP (Nothing displays) 如何在原生NodeJS中通过IP地址和端口获取域名? - How to get domain name by IP Address and port in native NodeJS? 使用 Node.js 为本地服务器配置域名 - Configure the domain name for local server using Node.js Node.js请求模块中的IP地址而不是域名 - IP address instead of a domain name in node.js Request module 连接到IP地址但不在域名中时出现404错误 - 404 error when connecting to IP address but not in domain name Digital Ocean nginx服务器可以通过IP地址访问但不能自定义域名 - Digital Ocean nginx server can be accessed via IP address but not custom domain name 在节点应用程序中使用restify时配置域名而不是IP地址 - Configuring domain name instead of IP address while using restify in node app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM