LinuxQuestions.org
Help answer threads with 0 replies.
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 08-11-2004, 12:21 PM   #1
sichen
Member
 
Registered: Mar 2004
Posts: 31

Rep: Reputation: 15
how to force ip address/host name pair


How do I force an ip address/host name pair, so that on my computer, www.mydomain.com will be directed to a certain IP address, rather than through the internet's name server?

For example, on windows, I can edit
c:\windows\system32\drivers\etc\hosts
and add a line
111.222.333.444 www.mydomain.com

And then all requests for www.mydomain.com will be forced to 111.222.333.444

I have added the same to /etc/hosts and then edited /etc/host.conf so that it says:
order hosts, bind
multi on

But still it does not work. Is there another file that needs to be edited?

(I have restarted with /etc/init.d/network restart) and it still does not work.

Thanks!

Si

PS I am running Fedora Core 1.
 
Old 08-11-2004, 01:58 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Seems to me what you did should have done the trick.

Perhaps edit your /etc/hosts again and drop the 'www.':
Code:
111.222.333.444 	mydomain.com
 
Old 08-11-2004, 02:09 PM   #3
sichen
Member
 
Registered: Mar 2004
Posts: 31

Original Poster
Rep: Reputation: 15
tried that and it didn't work.

strange, huh?
 
Old 08-12-2004, 01:59 AM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Another thought: do you have an /etc/nsswitch.conf file? If so make sure it has these lines:
Code:
hosts:          files dns
networks:    files dns
HTH
 
Old 08-12-2004, 10:50 AM   #5
sichen
Member
 
Registered: Mar 2004
Posts: 31

Original Poster
Rep: Reputation: 15
it already had those lines 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
Force sendmail to send mail on an ip address sdave1284 Linux - Software 8 11-23-2005 11:26 PM
Error IP address already used by another host lngmn7 Linux - Networking 2 08-29-2005 04:41 AM
Change Host and Ip address Fedora 3 s1goldman Linux - Newbie 3 01-04-2005 04:24 PM
eth0 and host address tommytomato Linux - Newbie 2 12-03-2003 04:29 PM
iptables - blocking a host by MAC address retiem Linux - Security 6 08-29-2003 11:58 AM

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

All times are GMT -5. The time now is 11:44 AM.

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