LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-16-2009, 09:41 AM   #1
fedora_user
Member
 
Registered: Jan 2006
Posts: 112

Rep: Reputation: 15
Redirecting website to another server


hello
i hope this will be a simple one:
i work for a company which has a server. It runs dns bind service and apache hosting several virtual domains. the server was setup by my predecessor. my boss has told me that one of the website is to be hosted on another server. so i changed the www entry to point to the new server. the new server is serving the pages fine. the only issue is that if you type the address of this website without www ie http://joebloggs.com it goes back to the old server, the one i manage. how can i get it to point to the new server?
i have tried making the following entries into the dns but no luck:

joebloggs.com. IN A 198.37.219.162
and
*joebloggs.com. IN A 198.37.219.162

But no luck. i have made entries into the hosts file but again no luck. i would really appreciate some direction on this.
regards
 
Old 04-16-2009, 12:26 PM   #2
cmdln
Member
 
Registered: Apr 2009
Location: Lawrence, KS
Distribution: Debian, Centos
Posts: 102
Blog Entries: 1

Rep: Reputation: 24
You said you have tried overriding the site in /etc/hosts correct?

Its possibly your seeing a cache or your browser has cached the address of the remote server.

Try using another browser and see if you still experience the issue.

I wrote an article a while back on how to properly move a website.

Sounds like you are experiencing a caching issue though. But take note that all dns servers are not configured equally. It may take a lot longer than you expect for full propagation of your A record changes to take place.
 
Old 04-16-2009, 04:29 PM   #3
maresmasb
Member
 
Registered: Apr 2009
Posts: 108

Rep: Reputation: 24
You need to set an alias name in your Apache virtual host configuration to make www.domain.com equal to domain.com. Also remove the virtual host configuration from the previous server to avoid confusion. It is better to serve a page-not-found error, rather then displaying outdated information.

Last edited by Tinkster; 10-30-2010 at 04:16 PM.
 
Old 04-16-2009, 05:02 PM   #4
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
looks like the @ record is point to the old server so that is why when no www is specified it is saying go to the address that belongs to joebloggs.com (the original address).
 
Old 04-21-2009, 06:52 AM   #5
fedora_user
Member
 
Registered: Jan 2006
Posts: 112

Original Poster
Rep: Reputation: 15
sorry for late reply

cmdln,
after each change i did restart bind. my undesrstanding is that will have cleared any cache on the server end. yes, each time after the cahnge on the server i would always clear the cache on the browser(two of them just in case).

maresmasb
i have read alot about having to write a bit of script to make this change. However before i do this are you sure there isnt anyway of utilising the dns to make the same effect of redirection?
if not is the redirection a straight forward thing?

jstephens84
thanks for that. i manged to get the a record set so it points to the new server but only if the prefix www is used...not sure why?
 
Old 04-21-2009, 11:38 AM   #6
fedora_user
Member
 
Registered: Jan 2006
Posts: 112

Original Poster
Rep: Reputation: 15
maresmasb,
did you mean to add an alias name to the old apache server or the new one?
 
Old 04-21-2009, 02:58 PM   #7
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by fedora_user View Post
sorry for late reply

cmdln,
after each change i did restart bind. my undesrstanding is that will have cleared any cache on the server end. yes, each time after the cahnge on the server i would always clear the cache on the browser(two of them just in case).

maresmasb
i have read alot about having to write a bit of script to make this change. However before i do this are you sure there isnt anyway of utilising the dns to make the same effect of redirection?
if not is the redirection a straight forward thing?

jstephens84
thanks for that. i manged to get the a record set so it points to the new server but only if the prefix www is used...not sure why?
DNS providers setup an @ that points to a single ip. so if someone goes to say http://domain.com it will now to point to the server at that domain. However www most of the times is setup as an alias to the @ record.
 
Old 04-22-2009, 05:23 AM   #8
fedora_user
Member
 
Registered: Jan 2006
Posts: 112

Original Poster
Rep: Reputation: 15
still stuck

Quote:
Originally Posted by jstephens84 View Post
DNS providers setup an @ that points to a single ip. so if someone goes to say http://domain.com it will now to point to the server at that domain. However www most of the times is setup as an alias to the @ record.
i thought i had the www.joebloggs.com (with www) working but i realised after 5 days (gave time for propergation) that if i visit the site from outside of our network its still not redirecting to the new servers regardless of whit or without www. This means i still havent resvolved the issue. something tells me that because im in charge of the joebloggs.com domain and that my server is called joebloggs.com theres something else that needs to be acheived.jstephens84 im still unsure what i need to do to get this thing working. i have added "www A 138.39.261.143" into the zone file so the website gets redirected but its only doing it within the network, not outside ie from home you still see the old site.
 
Old 04-22-2009, 06:48 AM   #9
fedora_user
Member
 
Registered: Jan 2006
Posts: 112

Original Poster
Rep: Reputation: 15
just to add i also made an entry into the hosts file with the corresponding ip address but that hasnt worked unfortunately...
 
Old 04-22-2009, 08:28 AM   #10
cmdln
Member
 
Registered: Apr 2009
Location: Lawrence, KS
Distribution: Debian, Centos
Posts: 102
Blog Entries: 1

Rep: Reputation: 24
Are you sure you changed the A record on the aithoritave NS?
 
Old 04-22-2009, 09:12 AM   #11
fedora_user
Member
 
Registered: Jan 2006
Posts: 112

Original Poster
Rep: Reputation: 15
cmdln
yes im quite sure.

named.conf
zone "joeblogs.com" IN {
type master;
file "joebloggs.com.zone";
allow-update { xxx.xx.x.xxx; xxx.xx.x.xxx; ... };


joebloggs.com.zone:

joebloggs.com. A xxx.xx.xxx.xxx
www A xxx.xx.xxx.xxx


the name server for this domain is under my control. the A record entry only allows the users on my network to be able to see the site in the new location. however from outside it still pointing to the hosted files on my apache server hence i cant turn it off just yet. could there be another file that perhaps needs changing?ive tried all sorts of things but to no avail. i thought it might be because i hadnt given the proporgation enought time buts its been several days since the change.
 
Old 04-22-2009, 09:29 AM   #12
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by fedora_user View Post
cmdln
yes im quite sure.

named.conf
zone "joeblogs.com" IN {
type master;
file "joebloggs.com.zone";
allow-update { xxx.xx.x.xxx; xxx.xx.x.xxx; ... };


joebloggs.com.zone:

joebloggs.com. A xxx.xx.xxx.xxx
www A xxx.xx.xxx.xxx


the name server for this domain is under my control. the A record entry only allows the users on my network to be able to see the site in the new location. however from outside it still pointing to the hosted files on my apache server hence i cant turn it off just yet. could there be another file that perhaps needs changing?ive tried all sorts of things but to no avail. i thought it might be because i hadnt given the proporgation enought time buts its been several days since the change.
So when I did a nslookup it points to another ip. Not the one specified. Also from a quick whois search you need to change the record here.
DNS1.MICROTECH.CO.GG
DNS2.MICROTECH.CO.GG

These can be changed by going to where ever your dns hosting which most of the time is the registrar also, and change the records there. Looks like all you changed where the records for the internal network. Not for the rest of the world.
 
Old 04-24-2009, 06:32 AM   #13
fedora_user
Member
 
Registered: Jan 2006
Posts: 112

Original Poster
Rep: Reputation: 15
could it be because of this....

Quote:
Originally Posted by jstephens84 View Post
So when I did a nslookup it points to another ip. Not the one specified. Also from a quick whois search you need to change the record here.
DNS1.MICROTECH.CO.GG
DNS2.MICROTECH.CO.GG

These can be changed by going to where ever your dns hosting which most of the time is the registrar also, and change the records there. Looks like all you changed where the records for the internal network. Not for the rest of the world.
jstephens84
joebloggs is a fictitious domain. its not the real domain. im a little concerned to have the real one up. sorry about the confusion.

i have the following at the beginig of my dns zone file(which is also called joebloggs.com.zone:

joebloggs.com IN SOA papa.com. email.papa.com. (
2005120901 ; serial
900 ; refresh (15 minutes)
900 ; retry (15 minutes)
1209600 ; expire (2 weeks)
43200 ; minimum (12 hours)
)
NS z.xc.xxx.xx.xx.
NS z.xc.xxx.xx.xx.
NS papa.com.
A 123.34.333.3
joebloggs.com. A 198.37.219.162
*joebloggs.com. A 198.37.219.162

----------------
123.34.333.3 = old server
198.37.219.162 = new server
papa.com. = dns server name local



is it possible that this line :
A 123.34.333.3 is causing the issue? i tried taking it out and unfortuantely it stops things like emails ie imap.joebloggs.com etc
is there anyway of getting round it?
 
Old 05-07-2009, 05:55 AM   #14
fedora_user
Member
 
Registered: Jan 2006
Posts: 112

Original Poster
Rep: Reputation: 15
found the answer at last!

basically it was my stupid and fundamental mistake....wait for it...
i forgot to update the serial number in zone file.
yes, i know. The zone transfer process wasnt happening.
i didnt know it was so important.
thanks for all the help as well.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
redirecting https web page to http internal website baboow Linux - Server 2 12-17-2007 09:27 AM
redirecting to another server saxa Linux - Networking 4 07-27-2007 01:29 PM
Redirecting Server Cottsay Linux - Software 3 11-13-2006 09:43 AM
Server Is Redirecting Me To An Old Domain... Lul2x Linux - Networking 1 10-05-2006 02:35 PM
Redirecting URL to another server wilcoNL Linux - Software 3 04-05-2004 08:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:18 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration