LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-14-2010, 01:32 AM   #1
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Post DNS settings on a local network


hi guys, how to resolve an ip with a port in linux?
i mean like this:

http://192.168.1.10:8000, how to include this on the dns. So the user don't have to remember the ip address and the port.

like the user will only type http://scanfiles then it will resolve the corresponding ip. is it possible?

Thanks.
 
Old 12-14-2010, 02:32 AM   #2
Angel2953
Member
 
Registered: Sep 2005
Location: Poland
Distribution: Debian, Ubuntu
Posts: 38

Rep: Reputation: 16
.htaccess, mod_http_proxy and mod_rewrite with apache:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^scanfiles$
RewriteRule ^(.*)$ "http\:\/\/192\.168\.1\.10\:8000%{REQUEST_URI}" [P,QSA,L]
 
Old 12-16-2010, 07:54 PM   #3
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Smile

Quote:
Originally Posted by Angel2953 View Post
.htaccess, mod_http_proxy and mod_rewrite with apache:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^scanfiles$
RewriteRule ^(.*)$ "http\:\/\/192\.168\.1\.10\:8000%{REQUEST_URI}" [P,QSA,L]
Hi Angel, sorry quite new with apache so i had to edit those files .htaccess, mod_http_proxy and mod_rewrite and place those codes? thanks.
 
Old 12-17-2010, 02:16 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by JJJCR View Post
Hi Angel, sorry quite new with apache so i had to edit those files .htaccess, mod_http_proxy and mod_rewrite and place those codes? thanks.
No, you'd create a .htaccess file in the right location and use the modules by virtue of the directives listed. My personal preference would be to put any config in your httpd.conf directly, not in an .htaccess file.

Another approach could be to use mod_proxy:

ProxyPass / http://127.0.0.1:8080

within the virtualhost for the "scanfiles" website. That way you don't redirect the client at all, and you always have the nice looking url.

Note that the solution given here does NOT answer your question, as your question is an invalid one. DNS names have nothing whatsoever to do with ports, it doesn't make sense to resolve something to a port, so you'd do it in a different way.

Last edited by acid_kewpie; 12-17-2010 at 02:20 AM.
 
1 members found this post helpful.
  


Reply

Tags
dns, port



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Setting on DNS on local network jmc1987 Linux - Server 3 11-06-2009 02:01 AM
DJB DNS - help setting up, local network andy holland Linux - Server 0 05-15-2008 06:42 AM
Network settings / DNS Server settings uid0sd Linux - Newbie 3 02-22-2007 03:39 PM
Problem same DNS between Internet and local network b:z Linux - Networking 6 03-28-2005 06:03 AM
FC2: DNS network settings for wireless Kropotkin Fedora 8 12-29-2004 08:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration