<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Focus the Web Tech Blog &#187; ip</title>
	<atom:link href="http://tech.focustheweb.com/tag/ip/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.focustheweb.com</link>
	<description>Programmazione, web, internet, howtos, etc.</description>
	<lastBuildDate>Sat, 24 Apr 2010 09:16:53 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Risolvere un nome host da un indirizzo IP in Ruby</title>
		<link>http://tech.focustheweb.com/programmazione/ruby-programmazione/risolvere-un-nome-host-da-un-indirizzo-ip-in-ruby/</link>
		<comments>http://tech.focustheweb.com/programmazione/ruby-programmazione/risolvere-un-nome-host-da-un-indirizzo-ip-in-ruby/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 16:19:25 +0000</pubDate>
		<dc:creator>Giovanni Cappellotto</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[host]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://tech.focustheweb.com/?p=327</guid>
		<description><![CDATA[







Ecco un altro promemoria: come risolvere un nome host da un indirizzo IP in Ruby.
Per eseguire l&#8217;operazione viene in nostro aiuto la class Resolv.
Esempio (usando Rails):

hostname = Resolv.new.getname&#40;request.env&#91;'REMOTE_ADDR'&#93;&#41;

Risorse utili:
 http://ruby-doc.org/stdlib/libdoc/resolv/rdoc/index.html
]]></description>
			<content:encoded><![CDATA[<p>
<!-- Begin Google Adsense code -->
<script type="text/javascript"><!--
google_ad_client = "pub-7194529311513014";
/* 468x60, creato 21/11/09 */
google_ad_slot = "8123373738";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Google Adsense code -->
<br />
Ecco un altro promemoria: come <em>risolvere un nome host da un indirizzo IP</em> in Ruby.</p>
<p>Per eseguire l&#8217;operazione viene in nostro aiuto la class <code><strong>Resolv</strong></code>.</p>
<p>Esempio (usando Rails):</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">hostname = Resolv.<span style="color:#9900CC;">new</span>.<span style="color:#9900CC;">getname</span><span style="color:#006600; font-weight:bold;">&#40;</span>request.<span style="color:#9900CC;">env</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'REMOTE_ADDR'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>Risorse utili:<br />
<a title="Resolv class documentation" href="http://ruby-doc.org/stdlib/libdoc/resolv/rdoc/index.html"> http://ruby-doc.org/stdlib/libdoc/resolv/rdoc/index.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tech.focustheweb.com/programmazione/ruby-programmazione/risolvere-un-nome-host-da-un-indirizzo-ip-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
