LinuxQuestions.org
Visit Jeremy's Blog.
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 10-22-2008, 07:48 AM   #1
mws1
LQ Newbie
 
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
Routing and DNS


Hi everyone,

I'm currently assigning new IP addresses to quite a few network interfaces. The whole process includes modifying the OpenVPN configurations and routes.
I wonder if it makes sense to use host names instead of IP addresses when adding routes, e.g.
Code:
route add -host testsystem.mydomain.com gw gateway.mydomain.com
The idea behind that would be to minimize the effort of assigning new IP addresses next time ;-) Technically, this seems to work. But I'm not so sure if it's wise ... Any comments?

Michael

PS: The host names are resolved by a DNS within the local network.

Last edited by mws1; 10-22-2008 at 07:51 AM.
 
Old 10-22-2008, 07:58 AM   #2
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
no, the route command will resolve to an ip address on entry. when you later run something like "route" to show the routing table it does a reverse lookup to get a hostname. routing tables only contain ip addresses internally.
 
Old 10-22-2008, 08:54 AM   #3
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by acid_kewpie View Post
no, the route command will resolve to an ip address on entry. when you later run something like "route" to show the routing table it does a reverse lookup to get a hostname. routing tables only contain ip addresses internally.
More specifically, the hostname is converted to an IP at the time you run the command, so it does a one-time conversion. It doesn't ever lookup the hostname again. There's no functional difference between using a hostname and an IP when setting routes.

That should be clear from a_k's post, but I just wanted to reiterate it.
 
Old 10-22-2008, 11:53 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
that's what i thought i said, not clear enough i guess. ;-)
 
  


Reply



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
Problems with iptables, routing or dns. I really donīt know what is going on. stormrider_may Linux - Networking 2 02-02-2006 05:05 AM
iptables +DNS routing? rincewind Linux - Networking 2 03-17-2005 03:57 AM
VPN routing /DNS issue cyph3r7 Linux - Networking 1 05-06-2004 09:19 AM
Possible Routing / DNS Issue with Dial-Up connection on LAN connected PC geesloper Linux - Networking 2 12-06-2003 06:55 PM
LAN DNS/Web/routing question... prism ra Linux - Networking 3 10-07-2002 04:02 AM

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

All times are GMT -5. The time now is 10:07 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