atd atd - 1 year ago 119
Linux Question

how to asisgn dns to ip on nginx using node.js

I was wondering how to assign my domain name to my nginx webserver that running node.js on it, I am using ubuntu and I have already installed dns server ,
as you know every application on node.js uses specific port ,
more details:

I have domain name ( and I have server ip , my domain points to , but I want that when i enter , it shows details of my website that are in the , I dont know how to do it.I can access to my website details through ip:port but i dont know how to make it to be accessed from domain name (

so how may I do it?

Answer Source

I just found your answer here : How to assign a domain name to node.js server?


You dont assign a domain to a node.js server, instead you load your app onto a machine which has an ip adress, which in your case is You then need to make sure your app is listening on the correct port, which on most servers is 80

using express it's as simple as

var app = express()
  , server = require('http').createServer(app)
  , io = io.listen(server);

app.get('/', function(req, res) {


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download