LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-31-2013, 12:11 PM   #1
Vinay L
LQ Newbie
 
Registered: Jun 2012
Posts: 6

Rep: Reputation: Disabled
URG:Same Hostname for IPV4 & IPV6 address in /etc/hosts entry not working


Hi,

My /etc/hosts entry is as follows:

172.18.25.33 dns.search.com blrtestdev
::1 dns.search.com blrtestdev

Now I have developed an application which uses getaddrinfo to fetch the IP address using the hostname 'blrtestdev'.
On MAC 10.6 it is working fine. But on MAC 10.8 it is not working. Is adding entry on MAC 10.8 in /etc/hosts is different? Can't the same hostname(blrtestdev) be used for both IPV4 & IPV6 address? If I remove the the entry of fully-qualified domain name(dns.search.com) it works fine.

It would be helpful if the above doubts are clarified.

Thanks & Regards,
Vinay
 
Old 11-01-2013, 05:11 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2403Reputation: 2403Reputation: 2403Reputation: 2403Reputation: 2403Reputation: 2403Reputation: 2403Reputation: 2403Reputation: 2403Reputation: 2403Reputation: 2403
I'm not sure you can use the same FQDN and/or hostname for both ipv4 and ipv6. If I recall correctly this depends on how getaddrinfo is implemented.

Besides that, you also seem to point the same FQDN/hostname to two different interfaces (ipv4 points to a real interface and the ipv6 entry points to the loopback device).
 
  


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
How to set the default gateway if I configured IPv4 and IPv6 address? leericlapton Linux - Networking 1 10-26-2011 07:57 AM
libnetfilter_conntrack with IPv4 & IPv6 Washington Ratso Programming 0 07-07-2011 05:04 PM
referencing hosts by (special) hostname for IPv6 link local address Skaperen Linux - Networking 1 05-03-2010 10:21 AM
I get IPV6 address and no IPV4. Why? erics_acvw Linux - Networking 2 10-22-2006 08:12 PM
can a NIC have both, IPv4 and IPv6, address simultaneously?? b0nd Linux - Networking 2 06-04-2006 02:18 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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