[ask] Redirect domain ke IP

Diskusi tentang Ubuntu Server baik webserver, database server, samba server dan service lainnya serta jaringan menggunakan Sistem Operasi Ubuntu.
User avatar
ikh_one
Posts: 25
Joined: 04 Jan 2010, 06:35
Location: Jakarta, Indonesia
Contact:

[ask] Redirect domain ke IP

Postby ikh_one » 26 Jul 2012, 16:00

Allow mas bro...
mau tanya klo cara ngeredirect nama domain ke IP bagaimana ya?
saya udah coba pake iptables

iptalbes -t nat -A PREROUTING -i eth1 -d namadomain.com -p tcp --dport 80 -j DNAT --to 192.168.1.1

saya pasangnya di router
User avatar
KangPaidjo
Posts: 8
Joined: 13 Jan 2011, 12:03
Contact:

Re: [ask] Redirect domain ke IP

Postby KangPaidjo » 26 Jul 2012, 21:18

coba ini boss

#!/bin/sh
internet='eth0 # Or the interface on which you see the network
source="0.0.0.0/0.0.0.0" # this will redirect everybody to that port. If you want you may specify only one IP address or an IP range.
domain="redirect.mydomain.com" # the domain/subdomain that will be redirected sourcePort="22" #the port which you'll redirect.
toDestination="192.168.0.2" #where to redirect to. destinationPort="22" # on which port to redirect.

iptables -t mangle -P PREROUTING ACCEPT $IPTABLES -t nat -A PREROUTING -p tcp -i $internet --source 0.0.0.0/0.0.0.0 -d $domain --destination-port $serverPort -j DNAT --to-destination $toDestination:$destinationPort
User avatar
semut
Posts: 455
Joined: 05 Jul 2010, 19:15
Location: kendal,Indonesia
Contact:

Re: [ask] Redirect domain ke IP

Postby semut » 26 Jul 2012, 22:24

bentar2.... maksudnya meredirect DomainName ke IP, itu gimana nih..?
tuh akses domain dr lokal atau dari internet ?
User avatar
ikh_one
Posts: 25
Joined: 04 Jan 2010, 06:35
Location: Jakarta, Indonesia
Contact:

Re: [ask] Redirect domain ke IP

Postby ikh_one » 27 Jul 2012, 12:45

semut wrote:bentar2.... maksudnya meredirect DomainName ke IP, itu gimana nih..?
tuh akses domain dr lokal atau dari internet ?


ya mendirect domain ke IP lokal, aksesnya dari lokal aja supaya si klien klo ngebuka domain tersebut langsung di direct ke IP lokal begitu
User avatar
ikh_one
Posts: 25
Joined: 04 Jan 2010, 06:35
Location: Jakarta, Indonesia
Contact:

Re: [ask] Redirect domain ke IP

Postby ikh_one » 27 Jul 2012, 12:48

KangPaidjo wrote:coba ini boss

#!/bin/sh
internet='eth0 # Or the interface on which you see the network
source="0.0.0.0/0.0.0.0" # this will redirect everybody to that port. If you want you may specify only one IP address or an IP range.
domain="redirect.mydomain.com" # the domain/subdomain that will be redirected sourcePort="22" #the port which you'll redirect.
toDestination="192.168.0.2" #where to redirect to. destinationPort="22" # on which port to redirect.

iptables -t mangle -P PREROUTING ACCEPT $IPTABLES -t nat -A PREROUTING -p tcp -i $internet --source 0.0.0.0/0.0.0.0 -d $domain --destination-port $serverPort -j DNAT --to-destination $toDestination:$destinationPort


terlalu rumit masbro, saya yg simple aja
User avatar
semut
Posts: 455
Joined: 05 Jul 2010, 19:15
Location: kendal,Indonesia
Contact:

Re: [ask] Redirect domain ke IP

Postby semut » 27 Jul 2012, 14:23

setahu semut, kalau ip server DNS udah di jadikan default di DNS-server maka penamaan domain lgsung bisa dipakai mas bro..
misal ip dns-server : 192.168.0.2
dipasang di client-linux di

Code: Select all

# echo "nameserver 192.168.0.2" > /etc/resolv.conf


kalau di client wind$
di dns-server

*CMIIW..
User avatar
ikh_one
Posts: 25
Joined: 04 Jan 2010, 06:35
Location: Jakarta, Indonesia
Contact:

Re: [ask] Redirect domain ke IP

Postby ikh_one » 27 Jul 2012, 14:46

semut wrote:setahu semut, kalau ip server DNS udah di jadikan default di DNS-server maka penamaan domain lgsung bisa dipakai mas bro..
misal ip dns-server : 192.168.0.2
dipasang di client-linux di

Code: Select all

# echo "nameserver 192.168.0.2" > /etc/resolv.conf


kalau di client wind$
di dns-server

*CMIIW..


wah sy ga maen di dns server bro semut malah ga diinstal, cuma mau redirect pake iptables aja
User avatar
blackshirt
Posts: 2336
Joined: 02 Jan 2010, 17:00
Location: Solo dan Kebumen
Contact:

Re: [ask] Redirect domain ke IP

Postby blackshirt » 09 Sep 2012, 07:52

bukan domain maksudnya mungkin... Hostname kali

Return to “Ubuntu Server”

Who is online

Users browsing this forum: No registered users and 6 guests